Nov 23, 2004 #1 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!
Hi I was wondering is it possible to use Vlookup formulas in a Macro? If so how? So many questions today... Thanks!
Nov 23, 2004 #2 ilses Technical User May 31, 2001 235 DE To put a lookup formula in a cell: Range("C2").Formula = "VLOOKUP(C1,A1:B15;2)" Ilse Upvote 0 Downvote
Nov 23, 2004 #3 Zathras Programmer Nov 12, 2002 3,317 US 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) Upvote 0 Downvote
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)