Hello there.
I'm working on an application and have hit a snag. I have a variable defined as an array with 6 values, N(5) As String
I am trying to populate this array with values from a single row, which I need to be matched via a Vlookup function. There are six values per row. I am getting an error stating "Unable to get the VLookup property of the WorksheetFunction class" (Run-time 1004)
Here is the code, with the bad line highlighted;
Dim LV As String
Dim N(5) As String
LV = Range("B2").Offset(i, 0).Value
For x = 0 To 5
N(x) = Application.WorksheetFunction.VLookup(LV, Range("Sheet3!A:AF"), x + 5, 0)
If Err.Number <> 0 Then Resume Next
Next x
Looking at the below website I see the formula is being declared as a variant, is this required? And if so, how would I go about modifying the code to include this?
cpearson page for calling worksheet functions
Thanks!
Bookmarks