I have a formula [=SUMIFS(Worksheet!R2C6:R50000C6,Worksheet!R2C9:R50000C9,RC1,Worksheet!R2C4:R50000C4,R13C,Worksheet!R2C1:R50000C1,R2C4)] that I need to add to every cell within a variable range based on which columns are populated in row 13. The range always starts at G14 but it can go on to multiple columns and rows.
I know I can find the last column using this:
Dim LastCol As Long
LastCol = Cells(13, Columns.Count).End(xlToLeft).Column
And I can get the last row using this:
Dim LastRow As Long
LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
But what I can't figure out is how to get the formula into LastRow:LastCol range. Does that make sense?
Thanks for any help!