Macro to put zeroes in front of "text" numbers


Posted by Matteo on September 26, 2001 6:49 AM

I have a file that was originally entered in as a special format to show the zeroes but I need the zeroes in there permanent - like '00012'. I already changed the column to text but the "numbers" are still 12, 123, 1234 when I need them to be and show like - 00012, 00123, 01234. They are in a column and there are 340 records. Please don't tell me I have to change them manually. Isn't there a macro that can do this ? Please ?

Posted by Barrie Davidson on September 26, 2001 7:05 AM

Matteo, how about using a formula to get your value. You can then copy the formula and paste values over your original data. This formula should do the trick for you.

=MID("0000000",1,5-LEN(A1))&A1

Regards,
BarrieBarrie Davidson



Posted by Matteo on September 26, 2001 7:13 AM

Worked like a charm ! Thank you so much. You are a lifesaver !!