I have a button that will vlookup the selected cell's text and reference a table in different sheet to return last name, first name. Here's what I have:
Sub button1()
Dim name As String
Dim ArrayRange As Range
Dim ActCell As Range
Set ActCell = ActiveCell
Sheets("Results").Select
Set ArrayRange = Sheets("Results").Range("A1", Range("A1").End(xlToRight).End(xlDown))
Sheets(1).Select
Lastname = Application.WorksheetFunction.VLookup(ActCell.Value, ArrayRange, 13, False)
FirstName = Application.WorksheetFunction.VLookup(ActCell.Value, ArrayRange, 12, False)
MsgBox Lastname & FirstName
End Sub
I am getting the error
unable to get the vLookup property of the WorksheetFunction class
Any help would be greatly appreciated!