I have an excel where I have to check if an account is present in which of two account listings. Else, I have to go to the next account. The code I am using is:
For x=1 to acc_num
Sheets("List1").Select
Range("A1:A100").Select
On Error GoTo CheckList2
Selection.Find(what:=x).Activate
GoTo Found
CheckList2:
Sheets("List2").Select
Range("A1:A100").Select
On Error GoTo NotFound
Selection.Find(what:=x).Activate
Found:
'More Code to execute if account is found
NotFound:
On Error GoTo 0
Next x
When an account is not found in List1 I still get the error pop-up: Run-time '91' : Object variable or With block not set.
I am unable to see why the error handling is not doing its job. Please help me out.