Further to the above, I think it would be easier to insert the formula rather than a dynamic vlookup because I need to put the result in a number of cells so would be better to get the formula then drap down to last row. so, I have the following code that does this but I need to change it as the workbook in the table array will change year to year so next year when I run this code the table array will be in the workbook with the same name but ending 2015.
Code:
what I have
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[Shipment Report 2014.xls]Weekly Shipped Details'!R5C9:R1000C9,1,0)"
I need something like
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[""Shipment Report"" & Year(Date) & "".xls]""Weekly Shipped Details'!R5C9:R1000C9,1,0)"
Bookmarks