I am getting an error that I haven't referanced this function correctly and I can't seem to find out which part is causing the problem. I am trying to use the vlookup function to gather selected values but an having issues with ever vlookup referance I use.
Error 1004 - Unable to get the vlookup property of worksheet function class.
Error 1004 - Unable to get the vlookup property of worksheet function class.
Code:
Private Sub CommandButton4_Click()
If TextBox5.Value = "" Then
MsgBox "Please enter data."
ElseIf Application.WorksheetFunction.VLookup(TextBox5.Value, Worksheets("HiddenData").Range("A24:K373"), 2, False) = "" Then
'If no info
MsgBox "invalid data."
Else
TextBox4.Text = Application.WorksheetFunction.VLookup(TextBox5.Value, Worksheets(HiddenData").Range("A2:K373"), 2, False)
TextBox6.Text = Application.WorksheetFunction.VLookup(TextBox5.Value, Worksheets("HiddenData").Range("A2:K373"), 3, False)
TextBox7.Text = Application.WorksheetFunction.VLookup(TextBox5.Value, Worksheets("HiddenData").Range("A2:K373"), 9, False)
End If
End Sub