Greetings All,
I have a range of data in column A and I want to identify all instances of a number in the range. The number is actually part of a string which is alpha numeric.
example:
147258 found in 7777
123456 found in 9999
123456 found in 9999
123456 found in 9999
654321 found in 8888
654321 found in 8888
654321 found in 8888
I have 123456 in a variable TicketNum and I want to identify all instances of it. In the above example the 3 lines in red should be selected. My current way is only finding 1 at a time. Here is my code:
once selected, these will be cut and paste to another tab.
thanks in advance
I have a range of data in column A and I want to identify all instances of a number in the range. The number is actually part of a string which is alpha numeric.
example:
147258 found in 7777
123456 found in 9999
123456 found in 9999
123456 found in 9999
654321 found in 8888
654321 found in 8888
654321 found in 8888
I have 123456 in a variable TicketNum and I want to identify all instances of it. In the above example the 3 lines in red should be selected. My current way is only finding 1 at a time. Here is my code:
Code:
TicketNum = Left(sVal, InStr(1, sVal, " ") - 1)
'find all instances of value (ticketnumber)
Set rngSearch = ActiveSheet.Range("A2:A" & LastRow)
Set rngFound = rngSearch.Find(What:=TicketNum, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
rngFound.Select
once selected, these will be cut and paste to another tab.
thanks in advance