I am having trouble overcoming the error message arising from a find statement, when the item to be found is not present in the range being searched, and having the VBA macro continue with the search for other items in the find list, and was wondering if anyone has found a solution to this issue in excel 2003.
,
I need the macro continue to find the next items in the list because they may appear in the search range at a later date.
,
This is my loop where the error occurs;-
Do Until PSDataEnd = "TOTAL"
Workbooks("PAU Test Find" & ".xls").Activate
Range(PAURange).Select
On Error GoTo SupErrorProc
If Selection.Find(What:=CoSuper).Select = True Then ‘Error occurs here
On Error GoTo 0
ActiveCell.Offset(0, -1).Select
Selection.Copy
End If
Workbooks("Pay Sum Test " & PayNo & ".xls").Activate
ActiveCell.Offset(0, 5).Select
Selection.PasteSpecial Paste:=xlPasteValues
ActiveCell.Offset(1, -5).Select
PSDataEnd = (Mid(ActiveCell.Value, 3, 5))
CoSuper = ActiveCell.Value
Loop
ActiveCell.Offset(-1, 0).Select
PSRangeEnd = ActiveCell.Address
,
This is my current error process;-
SupErrorProc:
On Error GoTo 0
Workbooks("Pay Sum Test " & PayNo & ".xls").Activate
ActiveCell.Offset(1, 0).Select
CoSuper = ActiveCell.Value
Workbooks("PAU Test Find" & ".xls").Activate
Range(PAURange).Select
If Selection.Find(What:=CoSuper).Select = True Then ‘Debug error occurs here
Resume Next
End If
,
I have tried different things but always get a debug error at the find statement in the error process. Does anyone have a solution.
Regards trex