Hi
Is it possible to loop through a column of data and look for cells that cantains a value that has a lengh of 6 if found add a 0 in frotn of the current value. So 999999 would change to 0999999.
James
Hi
Is it possible to loop through a column of data and look for cells that cantains a value that has a lengh of 6 if found add a 0 in frotn of the current value. So 999999 would change to 0999999.
James
Sure, do it in a standard loop.
But be warned, that it is a number and excel would (at first opportunity) try to treat this as number (not as text). going bact to your 6 digits.
So make sure that a cell has text format (neithor geberal nor number would do).
Best Regards,
Kaper
I would recommend simply reformatting the column to a CUSTOM number format of "0000000". This will ensure all real numbers in that column display with 7-digits, it will add leading zeros for you in the display of those cells.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks