Vlookup Error

Joined
Jan 8, 2010
Messages
2
Reaction score
0
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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top