Hi. I'm trying to open an Excel Worksheet from VB and search through a range using the Excel MATCH function. Unfortunately, I keep getting the "Unable to get the Match Property of the Worksheet Function class" error.
(Worksheet is already open in Excel)
Dim MyRange As Range
Set MyRange = Application.Worksheets("Sheet1".Range("A1:A10"
If Not IsError(Application.WorksheetFunction.Match("Find This", MyRange, 0)) Then
Msgbox "Found it"
End If
If I go to the Immediate Window and do a ? Worksheets("Sheet1".Range("A1" I get the value of A1 in that spreadsheet.
Any idea what I'm doing wrong? Thanks!
PTW
(Worksheet is already open in Excel)
Dim MyRange As Range
Set MyRange = Application.Worksheets("Sheet1".Range("A1:A10"
If Not IsError(Application.WorksheetFunction.Match("Find This", MyRange, 0)) Then
Msgbox "Found it"
End If
If I go to the Immediate Window and do a ? Worksheets("Sheet1".Range("A1" I get the value of A1 in that spreadsheet.
Any idea what I'm doing wrong? Thanks!
PTW