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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HLOOKUP & VLOOKUP 1

Status
Not open for further replies.

airon

Programmer
Jun 21, 2001
21
0
0
US
This is probably pretty simple, but I am having some trouble figurit out.

I am trying to do some lookups in some Excel spreadsheets.
Is there a way to use HLOOKUP in VBA, I can do it in the actual spreadsheet, but I am running in to problems when I try to do it in VBA.

Aaron

example:
HLOOKUP("Axles", A1:C4,2,TRUE) VBA does not like ":"
 
You need to use something like this:

Worksheetfunction.HLookup("Axles",sheets("NameofSheet").Range("A1:C4"),2,true)

if you look at Worksheetfunction you will see that it has all the functions you can use in a excel.
 
Thanks for taking a minute and helping with my problem, it was very helpful.

Airon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top