I created an inventory worksheet with userforms. Now I have a problem with VLookup command. I want the name of the item is shown in the "txtName" after I scanned the barcode in the "txt2DBarcode."
Everything looks fine till I send the information. Then I receive an error.
Run-time error '1004': Unable to get the VLookup property of the worksheetFunction class.
Everything looks fine till I send the information. Then I receive an error.
Run-time error '1004': Unable to get the VLookup property of the worksheetFunction class.
HTML:
Private Sub txt2DBarcode_A_afterupdate()
If WorksheetFunction.CountIf(Sheet1.Range("A:A"), Left(Me.txt2DBarcode_A.Text, 16)) = 0 Then
MsgBox "This is an incorrect Barcode!"
Me.txt2DBarcode_A.Value = ""
Exit Sub
End If
With Me
.txtName = Application.WorksheetFunction.VLookup(Left(txt2DBarcode_A.Text, 16), Sheet1.Range("Vac_List"), 2, 0)
End With
End Sub