I have a selection.find inside of a for loop. Prior to the selection.find I have an on error goto. This process works fine up to and including the first error instance. After that, the next error instance causes a run time error (instead of going to).
A little background - what I'm doing here is isolating instances on 1 sheet (test) against another sheet (control). If the value exists on the control I copy the relevent data to the test sheet. Each day the old test becomes the new control and a new test is compared.
There's a few comments with no code, they are just my notes on the process, I haven't gotten past this error problem to complete it.
It acts like the 'on error' test is only performed once, and not each time through the loop....
So I tried setting the error to nothing, or 0, directly after e:, but it didn't work, I thought maybe clear the error buffer and force the code to test it each time ... ?
For i = 1 To myLastDataRowTest blah blah ... Sheets(sheetsControl).Select ' search the stock on the control sheet On Error GoTo e Columns("E:E").Select Selection.Find(What:=newStock, After:=ActiveCell, LookIn:=xlValues, LookAt:= _ xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True _ , SearchFormat:=False).Activate 'debug MsgBox "Found: " & newStock, vbCritical, "" ' check the control account against the test account 'if same copy the text on the control sheet 'paste the text to the test sheet 'return to test sheet and test range e: Sheets(sheetsTest).Select Range(myReturnAddress).Select Selection.Offset(-1, 0).Select next
I really appreciate your help