I want to say something like this in a Macro, but I'm not sure how to write it:
=IF(LEN(A1)=6,"00"&A1,IF(LEN(A1)=7,"0"&A1,A1))
Ideally, what I want to say is, that if the selected range (rather than a specific cell) contains less than 8 numbers (or even better a user defined number of characters, via a text entry dialogue), then put leading zero's before the number. I would then like to convert the selected range to Text format, which I could do using a seperate macro, but it would be nice if it can be achieved all in the same macro.
Is this possible to do?
Many thanks
Bookmarks