Changing data in a column

  • Thread starter Thread starter jerry chapman
  • Start date Start date
J

jerry chapman

I would like to write a macro to change all the used entries in column A
such that only the right most 5 characters are displayed for each entry.
What would such a macro look like?
 
Sub Right5()
Dim rng as Range, cell as Range
Set rng = columns(1).specialCells(xlConstants)
for each cell in rng
cell.Value = right(cell.Value,5)
Next
End Sub
 

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