The number in this cell is formatted as text or preceded by an apostrophe

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

I'm creating an excel 10 worksheet in vb .net. If I format a range with

oSheet.Range("G1", "Y1").NumberFormat = "0.00"

the finished worksheet shows the little green triangle in each cell in the
range, and it gives me the message "The number in this cell is formatted as
text or preceded by an apostrophe".

How do I turn these cells back into numbers with the proper numeric format?

Jeremy
 
¤ I'm creating an excel 10 worksheet in vb .net. If I format a range with
¤
¤ oSheet.Range("G1", "Y1").NumberFormat = "0.00"
¤
¤ the finished worksheet shows the little green triangle in each cell in the
¤ range, and it gives me the message "The number in this cell is formatted as
¤ text or preceded by an apostrophe".
¤
¤ How do I turn these cells back into numbers with the proper numeric format?
¤
¤ Jeremy
¤

You may want to post to microsoft.public.excel.programming if you don't get an answer here.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Try this :

oSheet.Range("G1:Y1").Cells.NumberFormat = "#,##0.00"

instead of this :

oSheet.Range("G1", "Y1").Cells.NumberFormat = "0.00"

Hope this helps

:)
 
Back
Top