Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Excel 2007.
Format (12,000) gives me 012 I want (12,??0) to be 12 with a leading space Question mark doesnt seem to work in Excel 2007 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use this...
Format(12, "@@@") -- Rick (MVP - Excel) "Gary" wrote in message ... I am using Excel 2007. Format (12,000) gives me 012 I want (12,??0) to be 12 with a leading space Question mark doesnt seem to work in Excel 2007 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need Format because this is part of a loop building a dynamic Message Box
that has several columns; I need the columns to be aligned for readability. Gary "Ryan H" wrote: I don't think you need to use Format. So you want "12" to look like " 12"? MyString = " 12" But I know if can't be that simple. Is "12" a value in a cell? If so, use this: MyString = " " & Range("A1").Value -- Cheers, Ryan "Gary" wrote: I am using Excel 2007. Format (12,000) gives me 012 I want (12,??0) to be 12 with a leading space Question mark doesnt seem to work in Excel 2007 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
YES !!! That works .
Thanks, Gary "Rick Rothstein" wrote: Use this... Format(12, "@@@") -- Rick (MVP - Excel) "Gary" wrote in message ... I am using Excel 2007. Format (12,000) gives me 012 I want (12,??0) to be 12 with a leading space Question mark doesnt seem to work in Excel 2007 . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can also use
Val(your string here) For example, Val(0000012) = 12 -- Cheers, Ryan "Gary" wrote: I need Format because this is part of a loop building a dynamic Message Box that has several columns; I need the columns to be aligned for readability. Gary "Ryan H" wrote: I don't think you need to use Format. So you want "12" to look like " 12"? MyString = " 12" But I know if can't be that simple. Is "12" a value in a cell? If so, use this: MyString = " " & Range("A1").Value -- Cheers, Ryan "Gary" wrote: I am using Excel 2007. Format (12,000) gives me 012 I want (12,??0) to be 12 with a leading space Question mark doesnt seem to work in Excel 2007 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
REPLACE command drops leading zeros | Excel Discussion (Misc queries) | |||
Using REPLACE command removes leading zeros | Excel Discussion (Misc queries) | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
How do I add leading spaces to a value? | Excel Worksheet Functions | |||
save text field w/ leading zeros in .csv format & not lose zeros? | Excel Discussion (Misc queries) |