Hello Everyone,
In a potion of my code below, I am having trouble with accounting for a dynamic range.
The red portion may not always end at row 9756. I want that to be dynamic, which I didn't have an issue with until the RC notation came into play.
My second issue is with the text in blue below. My autofill may not always go to row 20. For whatever reason, I can't seem to identify the last row and have it fill down. I got it to fill up from B4 to B1 though
How should I alter this so that the range for both the red text and blue text below will change in the event the number of rows changes?
Worksheets("Summary".Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=AVERAGEIF(PickingReport!R6C10:R9756C10,Smmary!RC[-1],PickingReport!R6C12:R9756)"
Range("B4").Select
Selection.AutofillDestination:=Range("B4:B20")
Range("B4:B20").Select
Your help is greatly appreciated. Thank you for your time!
In a potion of my code below, I am having trouble with accounting for a dynamic range.
The red portion may not always end at row 9756. I want that to be dynamic, which I didn't have an issue with until the RC notation came into play.
My second issue is with the text in blue below. My autofill may not always go to row 20. For whatever reason, I can't seem to identify the last row and have it fill down. I got it to fill up from B4 to B1 though
How should I alter this so that the range for both the red text and blue text below will change in the event the number of rows changes?
Worksheets("Summary".Range("B4").Select
ActiveCell.FormulaR1C1 = _
"=AVERAGEIF(PickingReport!R6C10:R9756C10,Smmary!RC[-1],PickingReport!R6C12:R9756)"
Range("B4").Select
Selection.AutofillDestination:=Range("B4:B20")
Range("B4:B20").Select
Your help is greatly appreciated. Thank you for your time!