'Excel Macro to add leading zero to any cell.
Sub addLeadingZero()
'get the value from cell
x = Sheet1.Cells(1, 1)
'add leading zero
x = "'000" & x
'print value with zero
MsgBox x
'store value back in cell
Sheet1.Cells(1, 1) = x
End Sub
Sub addLeadingZero()
'get the value from cell
x = Sheet1.Cells(1, 1)
'add leading zero
x = "'000" & x
'print value with zero
MsgBox x
'store value back in cell
Sheet1.Cells(1, 1) = x
End Sub
No comments:
Post a Comment