I'm just a beginner, but I have a simple Vlookup macro that I can't get to work.
Imagine an excel sheet that has a column with different numbers in each row. After a number is selected, the macro shortcut is used and a vlookup should run and return the text associated with that number.
Dim Resource As String
Resource = Selection.Copy
rName = Application.WorksheetFunction.VLookup(Resource, Sheets("Program Title").Range("D5:F305"), 3, False)
MsgBox "" & rName
End Sub
When I run this code, I get an "Run-time error '1004': Unable to get the VLookup property of the WorksheetFunction class"
Can someone let me know how this code should be fixed?