VBA与VBA

我试图做一个自动的vlookupfunction,但我得到一个运行时错误:

1004 "Unable to get the Vlookup property of the worksheet functionclass" 

需要一些帮助,在哪里可能出错,以及如何调整!

这是代码:

 Sub FINDSAL() 'On Error GoTo MyErrorHandler: Dim Seat_No As String Seat_No = InputBox("Enter the Seat Number:") If Len(Seat_No) > 0 Then nameit = Application.WorksheetFunction.Vlookup(Seat_No, Sheets("L12 - Data Sheet").Range("B4:E250"), 2, False) MsgBox "The name is : $ " & nameit Else MsgBox ("You entered an invalid value") End If Exit Sub MyErrorHandler: If Err.Number = 1004 Then MsgBox "Employee Not Present in the table." End If End Sub 

 Sub FINDSAL() On Error GoTo MyErrorHandler: Dim Seat_No As Integer Seat_No = InputBox("Enter the Seat Number:") If Len(Seat_No) > 0 Then nameit = Application.WorksheetFunction.Vlookup(Seat_No, Sheets("L12 - Data Sheet").Range("B4:E250"), 2, False) MsgBox "The name is : $ " & nameit Else MsgBox ("You entered an invalid value") End If Exit Sub MyErrorHandler: If Err.Number = 1004 Then MsgBox "Employee Not Present in the table." End If End Sub