I had this vb, it will able to add zero in-front .
But is it possible to add in 0 @ column C16 which number is in 4 digital number?
If not wrong, this code will change all the format to TEXT but i only want to change to TEXT of 4 digital number.
The rest which start from 1xxxx should remain as GENERAL format.
Since excel are not able to put 0 if it is not in text format.
But is it possible to add in 0 @ column C16 which number is in 4 digital number?
If not wrong, this code will change all the format to TEXT but i only want to change to TEXT of 4 digital number.
The rest which start from 1xxxx should remain as GENERAL format.
Since excel are not able to put 0 if it is not in text format.
Code:
Sub Add_Zeros() Dim a
Dim i As Long
With Range("C16", Range("C" & Rows.Count).End(xlUp))
.NumberFormat = "@"
a = .Value
For i = 1 To UBound(a, 1)
If Len(a(i, 1)) Then
a(i, 1) = Right("00000" & a(i, 1), 5)
End If
Next i
.Value = a
End With
End Sub