I am having difficulty using vlookup in vba using FormulaR1C1. I am tring to lookup a value from a table using the table O_Rng located in a different sheet. Here is what I have:
I get #Name error.
I have tried changing the lookup table value to
with no luck, yet I can use
and it gives me the correct result.
Any suggestions, thanks in advance!
HTML:
Dim O_Rng as range
set O_Rng = Range("org_tbl!$A$2:$H$59")
sheets("Sheet3").cells(2,9).select
activecell.offset(4,0).FormulaR1C1= "=vlookup(RC[-7],org_tbl!O_Rng,2,false)
I get #Name error.
I have tried changing the lookup table value to
HTML:
activecell.offset(4,0).formulaR1C1=
"=vlookup(RC[-7],Worksheets(""org_tbl"").range(""$A$2:$H$59""),2,false)
HTML:
Activecell.offset(4,0) = application.worksheetfunction _
.vlookup(Activecell.offset(4,-7),worksheets("org_tbl").range("$A$2:$H$59"),2,false)
Any suggestions, thanks in advance!