Nedd help Adding text to cells

S

Shani

I want to go through all cells in Column A and add "/", without the
quotes, at the end of the text. However if there is already a slash.
"/", at the end then i do not want to add anything.

so i would like my cells to look like:

google.com/
yahoo.com/
aol.com/
 
G

Gary''s Student

Enter this macro:

Sub slashit()
Dim r As Range
For Each r In Selection
s = r.Value
If Right(s, 1) = "/" Then
Else
r.Value = s & "/"
End If
Next
End Sub

Select the cells you want to modify and run the macro.
 

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

Top