I'm very new to VBA so please bear with me...
I'm trying to perform a vlookup where the workbook and worksheet referred to in table_array are string variables.
Specifically, the line of code I'm having trouble with is this:
ActiveCell.FormulaR1C1 = _
"=IF(ISNA(VLOOKUP(RC[5],'[Var1]Var2'!C5,1,FALSE,)),""NOT IN TRACKER"",""IN TRACKER"")"
Var1
is the name of the workbook I'm looking in and Var2
is the name of the worksheet. Both are stored as strings.
Every time my program gets to this line of code it triggers an application-defined or object-defined error.
Changed to
=IF(ISNA(VLOOKUP(RC[5],'[" & Var1 & "]" & Var2 & "'!C5,1,FALSE,)),""NOT IN TRACKER"",""IN TRACKER"")"