View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mark Lincoln Mark Lincoln is offline
external usenet poster
 
Posts: 227
Default Strange data type error

Numbers should align to the right in the absence of overriding
formatting. Text aligns to the left unless the cell format aligns it
differently. So if that cell is the only one right-aligned, I'm a bit
confused.

If everything else works in column D, then I don't think this is an
Excel problem that Microsoft needs to fix. There must be something
wrong with the particular cell in which you have that number. Let's
see what we can try:

What is the value of i when the code fails? Is it always the same? If
so, then cell Di (where i is the row) must be formatted incorrectly or
the number in it must be entered incorrectly. If not, then you
actually have a problem with more than one cell in that column. Or
with the macro code.

Assuming there is a problem with only one cell, try filling it in with
the contents of the cell above it by dragging (as if you were copying a
formula). This should put a number into the cell and overwrite any
problem formatting with a format that works. Alternatively, you could
copy a known working value from the same column and paste it into the
problem cell. Then change the value of the cell back to 1064.12 and
see if your code fails again.

If you still can't find the problem I could have you email the workbook
to me and attempt to find the problem directly. I hope you'll find it
first, though. Good luck, and let us know what you find out!