Replace a comma with a period in a cell containing a lastname, firstname, middle i

M

Mike C

Hello - I am trying to clean some data and need to change all of my
names from

McLaughlin, Victor, (i.e, comma) W

to

McLaughlin, Victor.(i.e., period) W

Is there an extract and replace formula or method of som sort (in
excel or access) that will allow me to pull the first comma from the
right and replace it with a period.

Thanks for any suggestions!
 
G

Gary''s Student

Select the cells you want to change and run this tiny macro:

Sub comma_tose()
For Each r In Selection
v = StrReverse(r.Value)
r.Value = StrReverse(Replace(v, ",", ".", 1, 1))
Next
End Sub

For example:
a,b,c,d
will be changed to:
a,b,c.d
 
M

Mike C

Select the cells you want to change and run this tiny macro:

Sub comma_tose()
For Each r In Selection
    v = StrReverse(r.Value)
    r.Value = StrReverse(Replace(v, ",", ".", 1, 1))
Next
End Sub

For example:
a,b,c,d
will be changed to:
a,b,c.d
--
Gary''s Student - gsnu2007f








- Show quoted text -

Thanks Gary
 

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