Hi,
I am trying to covert numbers in in a column to text in order to keep the leading zero's. I have managed to get the below to work but want to be able to have the range as dynamic not set on the end being row 100.
I need to have all cells with numbers in column A to be 5 characters long with leading zero's if needed.
Thanks for the help!
I am trying to covert numbers in in a column to text in order to keep the leading zero's. I have managed to get the below to work but want to be able to have the range as dynamic not set on the end being row 100.
I need to have all cells with numbers in column A to be 5 characters long with leading zero's if needed.
Thanks for the help!
VBA Code:
Dim cell As Range
Range("A2:A100").NumberFormat = "@"
For Each cell In Range("A2:A100")
cell = Format(cell, "00000")
Next cell