无法获取工作表中的WorksheetFunction类错误的VLOOKUP财产
Private Sub TextBox2_AfterUpdate() 'Badge Number
On Error GoTo Err
Dim tbl As ListObject, fndStr As String
Set tbl = Sheet9.ListObjects("EmployeeList")
fndStr = Trim(Me.TextBox2.Value)
MsgBox fndStr
If fndStr <> "" Then
Me.TextBox3.Value = Application.WorksheetFunction.VLookup(fndStr, tbl, 2, False) '<-- Error Line
End If
Exit Sub
Err:
MsgBox Err.Description
End Sub
我有一个命名为“EmployeeList的”和我使用的证件号码做简单的VLOOKUP,但我得到了不明原因的错误表。我知道以前有类似的问题,但在发布之前我确实阅读过。
正如您可以清楚地看到图像中的表名并输入了值为10
的vlookup函数的第一个参数,但它不会返回任何值,但会给出错误。不知道什么是错的。
'I tried this as well
Me.TextBox3.Value = Application.WorksheetFunction.VLookup(fndStr, Sheet9.Range("A1:F" & Rows.Count), 2, False) '<-- Error Line
'And this
Me.TextBox3.Value = Application.WorksheetFunction.VLookup(fndStr, Sheet9.Range("EmployeeList"), 2, False) '<-- Error Line
而且由于未知原因,我不能这样做
Application.Vlookup as well
Like when I do Application.V
Vlookup doesn't shows up in the list.
好,谢谢,我会尝试 – newguy