Hi All. I am trying to code a dynamic VLOOKUP that references the sheet before my current sheet. The reason is that I am copying a new sheet with updated data to the workbook and then need to compare the old data (previous sheet) to the new in order to flag newly added records. I am currently using the below formula but am getting a #NAME? error. I'm assuming it has to do with the previous sheet reference. Any and all help is appreciated.
Code:
Range("T2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP([@[Position '#]],'" & ActiveSheet.Previous.Name & "'!D:S ,16,0)"