->setCellValue numberformat ??

Topics: Developer Forum, User Forum
Mar 17, 2011 at 10:55 AM


I have the following code

->setCellValue('H' . $i, $row["regnr"])

but I want to field always appear as I type. if I for example enter 0123, then changed it to 123 in Excel. How do I get it to show 0123?

Mar 17, 2011 at 11:23 AM

This question has been asked and answered numerous times in the past:

Either set the value explicitly as a string, or set a number format mask for the cell that forces display of all digits (e.g. '#,##0' 0r '0') rather than default format.

This is exactly how you would need to do it in Excel itself.

Now please read this thread that offers some advice on how to resolve these types of problems yourself without needing to ask, and then respect my need for time doing things other than answering the same questions over and over again.