Hi all
I am sure this has probably been asked before, but I have done a search and can't see anything that matches.
I am currently working with a database which includes addresses. These addresses include the "area" in one of the cells, but I would like to remove all references to the area from the data. Unfortunately, the "area" could be in any of the address lines (so Address1, Address2, Address3, etc).
I am using this syntax -
Cells.Replace What:="Northway", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
(Northway is an example, not a real area - there are about 50-60 different areas that I need to remove).
For instance, an address could be 1 The Avenue, Northway, Mytown - where "Northway" is the area and is in Address2. Or it could be Flat 1, 1 The Avenue, Northtway, Mytown, where Northway is in Address3. However, that's straightforward enough. My problem comes when I have an address such as 1 Northway Avenue, Southway, Mytown. I have already established that Northway is an area and so should be removed, but as it is also part of the string in Address1, it's also getting removed from there as well; changing the data to read 1 Avenue, Southway, Mytown.
I hope this explains the issue - I'm not terribly proficient in VBA so would be grateful for any advice, thoughts or ideas, or to be pointed to any previous similar questions.
Many thanks
Ed
Bookmarks