ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lookup-function does not work (https://www.excelbanter.com/excel-programming/355164-lookup-function-does-not-work.html)

sammy

Lookup-function does not work
 
I have a simple VBA sub:

sub test
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)"
end sub

Result is error ('Run-time error '1004': Application-defined or object
defined error'). Is this Excel-bug or am I missing something?

Patrick Molloy[_2_]

Lookup-function does not work
 
your syntax is incorrect. Please read HELP on spreadsheet functions

Cells(1, 1).FormulaR1C1 = "=LOOKUP( 3 , R1C2:R5C2 ,R1C3:R5C3 )"

separate using commas




in this example the value 3 is looked up in the range B1:B5 and the match
in C1:C5 ( the 2nd column of t he range) is returned


"SamMy" wrote:

I have a simple VBA sub:

sub test
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)"
end sub

Result is error ('Run-time error '1004': Application-defined or object
defined error'). Is this Excel-bug or am I missing something?


sammy

Lookup-function does not work
 
Thanks.

"Patrick Molloy" kirjoitti:

your syntax is incorrect. Please read HELP on spreadsheet functions

Cells(1, 1).FormulaR1C1 = "=LOOKUP( 3 , R1C2:R5C2 ,R1C3:R5C3 )"

separate using commas




in this example the value 3 is looked up in the range B1:B5 and the match
in C1:C5 ( the 2nd column of t he range) is returned


"SamMy" wrote:

I have a simple VBA sub:

sub test
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)"
end sub

Result is error ('Run-time error '1004': Application-defined or object
defined error'). Is this Excel-bug or am I missing something?



All times are GMT +1. The time now is 01:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com