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.
|