Hi All,
I'm seeking some help for applying the autofill for a dynamic range, but when the start of the range can be anywhere in the spreadsheet.
In my example below, I'm using:
Range("C" & Rows.Count).End(xlUp).Offset(1).Select
ActiveCell.FormulaR1C1 = _
"=XLOOKUP(RC[-2],'Sheet1 (3)'!C[3],'Sheet1 (3)'!C[-2],2,0)"
Selection.AutoFill Destination:=Range("C" & Rows.Count).End(xlUp).Offset(1)
I know the line with the autofill destination range is incorrect and what I'm seeing as suggestions is only for when you're starting at the beginning of a sheet, so the suggestion is: Selection.AutoFill Destination:=Range("C2: C" & Rows.Count).End(xlUp).Offset(1)
But in my case the start of the range is C199, not C2, and can vary with every report run.
I'm seeking some help for applying the autofill for a dynamic range, but when the start of the range can be anywhere in the spreadsheet.
In my example below, I'm using:
Range("C" & Rows.Count).End(xlUp).Offset(1).Select
ActiveCell.FormulaR1C1 = _
"=XLOOKUP(RC[-2],'Sheet1 (3)'!C[3],'Sheet1 (3)'!C[-2],2,0)"
Selection.AutoFill Destination:=Range("C" & Rows.Count).End(xlUp).Offset(1)
I know the line with the autofill destination range is incorrect and what I'm seeing as suggestions is only for when you're starting at the beginning of a sheet, so the suggestion is: Selection.AutoFill Destination:=Range("C2: C" & Rows.Count).End(xlUp).Offset(1)
But in my case the start of the range is C199, not C2, and can vary with every report run.