A cell formated numeric becomes a string when read

J

johnsday

I am reading a list of numbers formated as numbers with the following code
Sheet2.Cells(i,4). All but one cell, that is read as a string, are read as
numbers as they should be. When that one number is read it causes a data type
fault When that cell is checked for data type it always shows up as a
number. I am using Excel 2003 running on xp. The program is run from and
outputs to Sheet1 I can change the parameters so the number is read at
different positions in the loop but that number still causes a data type
fault

I need lots of help on this one. Many thanks for a solution here
 
B

Bob Greenblatt

I am reading a list of numbers formated as numbers with the following code
Sheet2.Cells(i,4). All but one cell, that is read as a string, are read as
numbers as they should be. When that one number is read it causes a data type
fault When that cell is checked for data type it always shows up as a
number. I am using Excel 2003 running on xp. The program is run from and
outputs to Sheet1 I can change the parameters so the number is read at
different positions in the loop but that number still causes a data type
fault

I need lots of help on this one. Many thanks for a solution here


First, this is a Macintosh news group. But, the Excel problem you are seeing
is probably the same on all platforms. Most likely, the one cell is really
not a number, but text, even though it looks like a number. Check to see if
there is a leading apostrophe in the cell - look in the formula bar with the
cell selected. Next, place the cursor into the formula bar and press enter.
This should force the cell back to a number if the cell is formatted as
General, or some other numeric format. If this does not work, enter a 1 in
some unused cell. Copy it. Click on the error cell and select edit-paste
special and click on multiply. This will force the cell to a numeric value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top