ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting Number as Text (https://www.excelbanter.com/excel-programming/305205-re-formatting-number-text.html)

Tom Ogilvy

Formatting Number as Text
 
activeCell.NumberFormat = "@"

formats the cell as Text

--
Regards,
Tom Ogilvy

"swaterhouse" wrote in message
...
I am populating cells in an excel spreadsheet from VB. I use the

NumberFormat property on the Columns collection to format numbers and dates
but I need to specify that a column is text. I have a customer with an
expense code that sometimes starts with leading 0's (i.e. 00125330). Is
there an expression I can use to force it to format as text on the
NumberFormat property or a different way entirly? I tried using "Text"
because I saw examples of using "Gemeral" to let it autoformat, but that
didn't work. I have also tried putting in a leading space but that didn't
work either.

Thanks
--
Scott





All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com