I appreciate the response, but with your code I still get an error 1004 when there is no match.
The only reason for the IsNothig was to handle the error, which it did, but I can't figure out how to advance to the next n.
I appreciate the response, but with your code I still get an error 1004 when there is no match.
The only reason for the IsNothig was to handle the error, which it did, but I can't figure out how to advance to the next n.
Sorry, it was erroring on the 2nd loop. Hadn't tested it thouroughly.
Try this
I can explain it if it works!![]()
For n = 1 To 12 On Error GoTo 0 'switch off error trap 'Set ws1 = Sheets(n) Sheets(n).Activate On Error Resume Next Set myvalue = Nothing myvalue = WorksheetFunction.Match(rec, Range("A1:A150"), 0) If Not myvalue Is Nothing Then MsgBox (myvalue) End If 10 Next n
Cheers
Mat
Sorry, it was erroring on the 2nd loop. Hadn't tested it thouroughly.
Try this
I can explain it if it works!![]()
For n = 1 To 12 On Error GoTo 0 'switch off error trap 'Set ws1 = Sheets(n) Sheets(n).Activate On Error Resume Next Set myvalue = Nothing myvalue = WorksheetFunction.Match(rec, Range("A1:A150"), 0) If Not myvalue Is Nothing Then MsgBox (myvalue) End If 10 Next n
Cheers
Mat
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks