Moving the last character within the cell so it will be the first

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

Hi

I'm faily new using VB. I wanted to move the last character so it will be
the first character if only that character is a - . This will be withing the
whole workbook.
 
Sub moveA()
For Each r In ActiveSheet.UsedRange
If IsEmpty(r.Value) Then
Else
v = r.Value
If Right(v, 1) = "a" Then
r.Value = "a" & Left(v, Len(v) - 1)
End If
End If
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