Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup in VBA
Hi All,
I'm trying the code below for a Vlookup and get "Application-defined or Object-defined error", I'd love to know why: Sub fact() Range("b50").Select Range("b50").Value = WorksheetFunction.VLookup("a50", "c39:d40", 2, [false]) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup in VBA
Hi
try: Range("b50").Value = WorksheetFunction.VLookup(range("a50"), range("c39:d40"), 2, 0) -- Regards Frank Kabel Frankfurt, Germany "teresa" schrieb im Newsbeitrag ... Hi All, I'm trying the code below for a Vlookup and get "Application-defined or Object-defined error", I'd love to know why: Sub fact() Range("b50").Select Range("b50").Value = WorksheetFunction.VLookup("a50", "c39:d40", 2, [false]) End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup in VBA
Thanks Frank - very helpful
"Frank Kabel" wrote: Hi try: Range("b50").Value = WorksheetFunction.VLookup(range("a50"), range("c39:d40"), 2, 0) -- Regards Frank Kabel Frankfurt, Germany "teresa" schrieb im Newsbeitrag ... Hi All, I'm trying the code below for a Vlookup and get "Application-defined or Object-defined error", I'd love to know why: Sub fact() Range("b50").Select Range("b50").Value = WorksheetFunction.VLookup("a50", "c39:d40", 2, [false]) End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
vlookup in VBA
Teresa-
Don't overlook the power of the Macro Recorder. Whenever you have trouble with worksheet functions in VBA, try recording the formula as you enter it in a cell. The recorder will show you the correct syntax. -Stan "teresa" wrote: Hi All, I'm trying the code below for a Vlookup and get "Application-defined or Object-defined error", I'd love to know why: Sub fact() Range("b50").Select Range("b50").Value = WorksheetFunction.VLookup("a50", "c39:d40", 2, [false]) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup in vlookup - taking the result as array name | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) | |||
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) | New Users to Excel | |||
Vlookup info being used without vlookup table attached? | Excel Worksheet Functions |