Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Force a Number to be Formatted as Text (keep leading 0's)
But if you had turned on the macro recorder and formatted a cell manually,
then turned it off and looked at the code you would have seen how to do it. Just a reminder that the macro recorder does have its uses. -- Regards, Tom Ogilvy "swaterhouse" wrote in message ... Thanks, never would have guessed that and certainly couldn't find it in any docs. -- Scott "Alex Guardiet" wrote: Hi, supposing G is the column you want to format, all you need is this line: Columns("G:G").NumberFormat = "@" Regards, Alex "swaterhouse" wrote: I need to set a column so the formatting is set to "Text" even if the value is numeric because the numeric value may have leading zeros that need to be there. I have used the NumberFormat property on the Colums collection to format numbers with specific numbers of decimals but cannot figure out how to set it to text. I tried settimg the value with a leading space but that didn't work. -- Scott |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Force a Number to be Formatted as Text (keep leading 0's)
I have to do the same thing but rather than read as text, I...
variable = Format(variable, "0000000000") Mar -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Columns formatted As Dates Are Exported as a Number to Text | Excel Discussion (Misc queries) | |||
Formatted number gets truncated when saved as tab delimited text | Excel Discussion (Misc queries) | |||
Use formatted text instead of number value... | New Users to Excel | |||
How do I force a leading zero character eg 07817 | Excel Discussion (Misc queries) | |||
How do I force leading zeros in an Excel cell? | Excel Discussion (Misc queries) |