Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Formatting Number as Text
I am not sure how you are populating the cells but have
you tried formating the cells as text before you populate the cells with data. I had this problem once. I think this is the way i solved it. this sample code from kindergarden excel works" Range("A1:A2").Select Selection.NumberFormat = "@" Range("A1").Select ActiveCell.FormulaR1C1 = "0111111" ActiveCell.Offset(1, 0).FormulaR1C1 = "000111222" -----Original 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formatting a number within a text formula | New Users to Excel | |||
Help with Formatting Number as Text | Excel Worksheet Functions | |||
Formatting from Number to Text | Excel Discussion (Misc queries) | |||
Formatting Number as Text | Excel Programming | |||
Formatting Number & Text in same cell | Excel Programming |