I am trying to write a VBA code that will autofill the formula to the last active cell in the column. The range varies each week, sometimes there will be 3 rows of data other times there will be more. Ideally the code is dynamic and will adjust without me having to manually update the code.
Right now the range is Range("R8:R10").
Sub Macro2Device()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-11],XHSCompletedOrders.xlsx!R2C7:R3341C21,2,FALSE)"
Selection.AutoFill Destination:=Range("R8:R10")
Range("R8:R10").Select
End Sub
Thanks
Right now the range is Range("R8:R10").
Sub Macro2Device()
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-11],XHSCompletedOrders.xlsx!R2C7:R3341C21,2,FALSE)"
Selection.AutoFill Destination:=Range("R8:R10")
Range("R8:R10").Select
End Sub
Thanks