Link to home
Start Free TrialLog in
Avatar of E=mc2
E=mc2Flag for Canada

asked on

How can I automate the removal of leading zeros and commas in Excel fields?

In an Excel spreadsheet, using VBA or any other script, I would like to remove leading zeros in field in a specific column, and I would also like to replace commas with nothing.
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

It sound like the column contains numeric data but is formatted as text.  If this is the case I would do the following:

1) Highlight all the data in the column and use the Replace function to replace commas with nothing.
User generated image2) Highlight all the data, click on the alert icon, and then select "Convert to Number"
User generated image
Regards,
-Glenn
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of E=mc2

ASKER

Thanks Glenn.  Seems to work after I enter the correct columns and fix the range to what I need.