I am about to move some formulas from new added rows in a sheet to a VBA-script. This script updates a dashboard. In that script I have used several VLOOKUP's but the search area always has been either a single column or a hard programmed range that never changes.
I now need to refer to a search area being an Excel table at a different sheet and I am struggling a bit how to transform the formula into VBA.
This is the Excel-formula (in Dutch)
=VERT.ZOEKEN([@Nr];Bestand_31122019;2;0)
[@Nr] is of course the lookup-value in the current sheet, which is an Excel-table.
Bestand_31122019 is the name of the Excel-table in a different sheet.
This should be the VBA-script
Range("CF2").FormulaR1C1 = "=VLOOKUP([@Nr], Bestand_31122019,2,0)"
Or with [ ]
Range("CF2").FormulaR1C1 = "=VLOOKUP([@Nr], [Bestand_31122019],2,0)"
So the question is how to refer to the search area, being an Excel-table called Bestand_31122019.
Which one would be correct if any ?