tourless
Board Regular
- Joined
- Feb 8, 2007
- Messages
- 144
- Office Version
- 365
- Platform
- Windows
Hi Folks,
I have a list of customers in column A. All of them start with "zz" which is simple enough to remove using...
Range("A2:A" & lRow).Replace what:="zz", Replacement:="", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, _
SearchFormat:=False, ReplaceFormat:=False
In that same list there are a variety of possible ending characters that I would like to remove as well. Some customers end with just their name which is fine. Others might end with "***OOB" or "***PO" or "***QT" or some variety therein. What I would like to do is any time the * character is found, remove it and anything that comes after it. I've tried variations on the following with no luck so far...
Range("A2:A" & lRow).Replace what:="(*)", Replacement:="", LookAt:=xlPart
UPDATE:
This has gotten me closer...
Range("A2:A" & lRow).Replace what:=" ~*", Replacement:="", LookAt:=xlPart
TIA!
I have a list of customers in column A. All of them start with "zz" which is simple enough to remove using...
Range("A2:A" & lRow).Replace what:="zz", Replacement:="", _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=True, _
SearchFormat:=False, ReplaceFormat:=False
In that same list there are a variety of possible ending characters that I would like to remove as well. Some customers end with just their name which is fine. Others might end with "***OOB" or "***PO" or "***QT" or some variety therein. What I would like to do is any time the * character is found, remove it and anything that comes after it. I've tried variations on the following with no luck so far...
Range("A2:A" & lRow).Replace what:="(*)", Replacement:="", LookAt:=xlPart
UPDATE:
This has gotten me closer...
Range("A2:A" & lRow).Replace what:=" ~*", Replacement:="", LookAt:=xlPart
TIA!
Last edited: