HI I'm trying to add function to my input form that when user puts ID number in to IDBox, the name come up automaticly in to NameBox.
aTable is my Table where I have ID in first column and name in second.
I'm getting "Unable to get the Vlookup property of the WorksheetFunction class" error
Thanks for your help.
aTable is my Table where I have ID in first column and name in second.
Code:
Private Sub IDBox_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim ws As Worksheet
Set ws = Worksheets("NamesBase")
Dim aTable As Range
Dim IDBoxValue As String
Dim NameFromID As String
IDBoxValue = IDBox.Value
Set aTable = ws.Range("A:B")
NameFromID = Application.WorksheetFunction.VLookup(IDBoxValue, aTable, 2, False)
NameBox.Value = NameFromID
End Sub
I'm getting "Unable to get the Vlookup property of the WorksheetFunction class" error
Thanks for your help.