I would appreciate any help or ideas with this. I receive an error
2042 or "Unable to get the VLOOKUP property of the WorksheetFunction
Class" when I use a VLOOKUP statement in VBA. I have an array with
dates in column 1 and numbers in columns 3 to 8. I would like to be
able to enter a date and search for a number in that row. My way of
doing this is to read each number in the row and test it. When I put
a Watch on myRange, I do not see a range so it may be that something
is wrong with the range but I can't see what it is.
Here is the statement:
Dim col As Integer
Dim Result As Variant
Dim startDate As Date
Dim myRange As Range
Set myRange = Worksheets("Sheet1").Range("A2:D10")
startDate = CDate(InputBox("Please enter Start Date: ", "START DATE"))
For col = 3 To 8
Result = Application.VLookup(startDate, myRange, col, False)
......
......
Next