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

VLookUp

Status
Not open for further replies.

icdastar

Technical User
Nov 16, 2004
12
US
Hi

I was wondering is it possible to use Vlookup formulas in a Macro? If so how? So many questions today...

Thanks!
 
To put a lookup formula in a cell:

Range("C2").Formula = "VLOOKUP(C1,A1:B15;2)"


Ilse
 
You can use most of the worksheet functions in VBA. For example, VLOOKUP could be used this way:

Code:
nResult = WorksheetFunction.VLookup("c", Range("A1:B4"), 2, 0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top