Brianwarnock
Retired
- Local time
- Today, 23:54
- Joined
- Jun 2, 2003
- Messages
- 12,701
In order to develop a bit of code for a poster in the EXCEL forum I tried to use the Match worksheet function, everything is fine is there is a match but if there isn't I get
The code does not run so error handling is not the issue.
can anybody help?
The code for what it is worth.
Brian
Runtime error '1004'
Unable to get the Match property of the Worksheetfunction class
The code does not run so error handling is not the issue.
can anybody help?
The code for what it is worth.
Code:
Private Sub worksheet_change(ByVal target As Range)
On Error Resume Next
myvar = Application.WorksheetFunction.Match(target.Value, Worksheets("Sheet2").Range("a1:a100"), 0)
If myvar = "#N/A" Then
MsgBox "nomatch"
Else: MsgBox "match"
End If
End Sub
Brian