Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Worksheet functions in forms

Status
Not open for further replies.

duncansancho

Technical User
Oct 9, 2003
45
0
0
GB
Hi All,
I hope someone out there can help! I am trying to use a worksheet function (VLookup in this case), in a form code.
I get an error 1004 and it shows my named range (Restrictions) as being "empty"!
What am I doing wrong please?

txtName = Application.WorksheetFunction.VLookup(txtNumber, Restrictions, 2)

Duncan
 
You need a reference which VBA understands:

txtName = Application.WorksheetFunction.VLookup(txtNumber, [Restrictions], 2)
or
txtName = Application.WorksheetFunction.VLookup(txtNumber, Range("Restrictions"), 2)

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top