Manipulating Data in a row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

How do I change data in a column via VBA. Here's what I am referring to: In
column A I have data that looks like this
0001
0002
0003

I need to take off the leading 0 so it looks like this:
001
002
003

Any help would be appreciated !

Developer
 
one way.

Sub takezero()

Dim cell As Range
For Each cell In Range("A1:A100")
cell.Value = Right(cell.Value, Len(cell.Value) - 1)
Next cell



End Sub
 
for each cell in selection
cell.Value = "'" & Right(cell.Text,3)
Next

This assumes the zeros are not produced using a custom format.
If that is the case, just change the custom format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top