ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find in a loop (https://www.excelbanter.com/excel-programming/336169-find-loop.html)

John

Find in a loop
 
I have a loop that is looking for "TA". However, when it finds TA in TAT...
i do not want it to do events on that row as if it was a "TA". The following
two lines are code I have tried to skip over "TAT" values in my search. Any
ideas on how to skip TAT values in my find loop?

If rngFound.Left = 3 = "TAT" Then rngToSearch.FindNext

If rngFound.Left = 3 = "TAT" Then GoTo FindNext

Tom Ogilvy

Find in a loop
 
set the proper arguments to FIND so it doesn't match TAT:

LookIn:=xlValues, LookAt:=xlWhole


Lookin:=xlValues
says to look at what the formula produces and not at the formula itself.

Lookat:=xlWhole means the match must be to the whole value of the cell.
then TA < match TAT

Lookin is provided for information. Lookat is critical to your question.
--
Regards,
Tom Ogilvy

"John" wrote in message
...
I have a loop that is looking for "TA". However, when it finds TA in

TAT...
i do not want it to do events on that row as if it was a "TA". The

following
two lines are code I have tried to skip over "TAT" values in my search.

Any
ideas on how to skip TAT values in my find loop?

If rngFound.Left = 3 = "TAT" Then rngToSearch.FindNext

If rngFound.Left = 3 = "TAT" Then GoTo FindNext




John

Find in a loop
 
ahh yes, thanks... I just was looking at that.

"Tom Ogilvy" wrote:

set the proper arguments to FIND so it doesn't match TAT:

LookIn:=xlValues, LookAt:=xlWhole


Lookin:=xlValues
says to look at what the formula produces and not at the formula itself.

Lookat:=xlWhole means the match must be to the whole value of the cell.
then TA < match TAT

Lookin is provided for information. Lookat is critical to your question.
--
Regards,
Tom Ogilvy

"John" wrote in message
...
I have a loop that is looking for "TA". However, when it finds TA in

TAT...
i do not want it to do events on that row as if it was a "TA". The

following
two lines are code I have tried to skip over "TAT" values in my search.

Any
ideas on how to skip TAT values in my find loop?

If rngFound.Left = 3 = "TAT" Then rngToSearch.FindNext

If rngFound.Left = 3 = "TAT" Then GoTo FindNext






All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com