Trim all but the first 5 characters in cell

  • Thread starter Thread starter Annette
  • Start date Start date
A

Annette

How would I write the trim to leave only the first five characters in a
column?
 
Dim rng as Range, cell as Range
With Activesheet
set rng = Intersect(.usedRange,.columns(5)).Cells
End With
for each cell in rng
cell = Left(cell.Text,5)
Next
 
that does the trick .. thanks!
Tom Ogilvy said:
Dim rng as Range, cell as Range
With Activesheet
set rng = Intersect(.usedRange,.columns(5)).Cells
End With
for each cell in rng
cell = Left(cell.Text,5)
Next
 

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