Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Lookup in a macro
Does VBA support an Application.Lookup command, and if so, how do you pass the
function its parameters? -- Regards, Fred |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Lookup in a macro
One way:
FInd additional help in XL/VBA Help ("List of Worksheet Functions available to Visual Basic"): Dim vResult As Variant Dim sLookup As String Dim rLookup As Range Dim rReturn As Range sLookup = "My Lookup Value" Set rLookup = ActiveSheet.Range("A1:A100") Set rReturn = ActiveSheet.Range("B1:B100") On Error Resume Next vResult = Application.WorksheetFunction.Lookup( _ sLookup, rLookup, rReturn) If Err.Number < 0 Then MsgBox "Not found" Else MsgBox vResult End If On Error GoTo 0 In article , "Fred Smith" wrote: Does VBA support an Application.Lookup command, and if so, how do you pass the function its parameters? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro Lookup | Excel Worksheet Functions | |||
Run Lookup only once - Macro | Excel Discussion (Misc queries) | |||
lookup macro | Excel Discussion (Misc queries) | |||
lookup macro?? | Excel Worksheet Functions | |||
Lookup macro? | Excel Programming |