Need help removing leading zeros from a list of numbers

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I have a list of numbers that have zeros in front of them
that I want to remove. The list is quite long, so I am
trying to find out how to do this either under formatting
or by use of a macro. Some of the numbers have only one
zero in front, while others have as many as three zeros in
front.

PLEASE HELP!!! WHAT DO I DO??

THANKS!!!
 
Hi
try the following macro
sub foo()
with activesheet.range("A1:A100")
.numberformat = "0"
.value = .value
end with
end sub
 
Frank,

That macro didn't work.

Thank you very much for the help, though. If you have any
other suggestions, let me know.

Lee
 
You stated that you have NUMBERS with leading 0s. Are they really NUMBERS or
do they have some text in them as well?
 
try the following macro
sub foo()
with activesheet.range("A1:A100")
.numberformat = "0"
.value = .value
end with
end sub
...

If it's just a matter of formatting, then no need for a macro - select the range
and change the format. If it's just a matter of numbers stored as text, then
again no need for a macro - select the range and run Data > Text to Columns,
Delimited, click Next then click Finish.
 
Hi
this should work if you only have numbers in these cells (tthough
Harlan's solution is easier to apply).
Does Harlan's solution work for you?
 
Back
Top