So I have a vlookup in VBA which refers to a tab in the activeworkbook :
Sheet3.Range("P2:P" & lrow).FormulaR1C1 = _
"=IF(VLOOKUP(RC11,'[theworkbookname.xlsx]HELP'!C7:C8,2,0)="""","""",""V0"")"
Now I want this formula to be flexible to name changes of the workbook.
So I thought about :
TB = ActiveWorkbook.Name
Sheet3.Range("P2:P" & lrow).FormulaR1C1 = _
"=IF(VLOOKUP(RC11,'[TB]HELP'!C7:C8,2,0)="""","""",""V0"")"
This obviously does not work.
Can it be tweaked to work or should an entire different approach be used?
Bookmarks