-
On Error Resume Next
For i = 3 To 500
pno = Cells(i, 4).Value 'source list
On Error Resume Next
Range(Cells(3, 1), Cells(100, 1)).Select 'target list
satbul = Selection.Find(What:=pno, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=True).Row
Cells(satbul, 2).Value = i
Next i
Before above rows was working properly. Now when an item doesn't find,
doesn't work.
Error number : '91' Object variable oe With block variable not set
What's problem.
Everybody thanks...
-
Re: On Error Resume Next
If a Find method fails to return a match then the object that is being set to the results will not be set (satbul).
So you need to trap for when it doesnt find anything and skip setting that value and moving on to the next.