Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Find & Replace Last n Characters in a Cell 2

Status
Not open for further replies.

Pugman

MIS
Aug 24, 2001
27
US
Brand new to VBA. I've been asked to develop macros to clean up Excel's PROPER function on mailing lists. I'm almost done but I'm stuck on how to tell Excel to replace the last 3 characters only of the following street address:

400 W Selby Ave Se 'The Se at the end should be SE

My code (from the macro recorder)
Code:
Sub AddressFix()
    Columns("N:N").Select
    Selection.Replace What:=" Se", Replacement:=" SE", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=True, SearchFormat:=False, _
        ReplaceFormat:=False
End Sub
changes Selby to SElby as well as Se to SE.

I'm hoping this is an easy solution.

Note: I have Ne, Nw and Sw to deal with also.

Thanks
 



Good one PHV. I missed that!

Skip,
[sub]
[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top