Petrini
04-28-2010, 01:50 PM
How can I write a number as string in a cell?
I'm using php but it's actually the same thing..
For example, I have a variable set as "042810":
$date = "042810";
When I set the cell value:
$worksheet->Range($range)->Value = $date;
It looks like 42810.
If I use NumberFormat, it would only work as a mask, the value would remain 42810.
If I set it as "'042810" (with apostrophe at the star), it would look right but the actual value in the cell would still keep the apostrophe.
What should I do?
Thank you!
I'm using php but it's actually the same thing..
For example, I have a variable set as "042810":
$date = "042810";
When I set the cell value:
$worksheet->Range($range)->Value = $date;
It looks like 42810.
If I use NumberFormat, it would only work as a mask, the value would remain 42810.
If I set it as "'042810" (with apostrophe at the star), it would look right but the actual value in the cell would still keep the apostrophe.
What should I do?
Thank you!