Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding leading zeroes to selected alphanumeric cells
Can anyone tell me why this only works on the FIRST cell of a
selection rather than ALL selected cells? Sub fixID() For Each rng In Selection rng.NumberFormat = "@" rng.Value = Right("000000" & rng.Value, 6) Exit Sub Next End Sub Pardon my ignorance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding leading zeroes to selected alphanumeric cells
On Sep 26, 11:01 am, "
wrote: Can anyone tell me why this only works on the FIRST cell of a selection rather than ALL selected cells? Sub fixID() For Each rng In Selection rng.NumberFormat = "@" rng.Value = Right("000000" & rng.Value, 6) Exit Sub Next End Sub Pardon my ignorance. nevermind: I read my post and saw the "exit sub" --oops |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format cells in web query (leading zeroes) | Excel Discussion (Misc queries) | |||
Leading Zeroes | Excel Discussion (Misc queries) | |||
Leading Zeroes | Excel Discussion (Misc queries) | |||
CSV leading zeroes | Excel Discussion (Misc queries) | |||
How do I format data cells in Excel to keep leading zeroes? | Setting up and Configuration of Excel |