Macro

C

C3

How to make a macro who will check one entire column (etc. A) for numbers
with 4 digits and less and change it to a 5 digits numbers.

Example:

499 to 00499
1480 to 01480

and 5 digits number leave unchanged.


Thanks!
 
D

Don Guillett

Just record this custom formatting. Modified to remove selections.
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 6/1/2004 by Don Guillett
'

'
Range("C1:C200").NumberFormat = "00000"
End Sub
 
G

Gord Dibben

C3

You don't need a macro for this, just select the column and
Format>Cells>Custom. Enter 00000 and OK.

If you want a macro...........

Sub Five_Digits()
Columns("A:A").Select
Selection.NumberFormat = "00000"
End Sub

Gord Dibben Excel MVP
 
Top