Lookup-function does not work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top