Good day folks,
I have code that exports a qry to Excel as a spreadsheet. With the help of this forum I have the following line of code that identifies the range and gets the last cell with data in it and then sums up the data in all the cells above the last cell. The problem is I want the sum to always begin at row 3, cell A3 and not cell A1, because there is a data in the first 2 rows that should not form part of this calculation. Any help in how to modify this to achieve that would be gratefully received:
John
I have code that exports a qry to Excel as a spreadsheet. With the help of this forum I have the following line of code that identifies the range and gets the last cell with data in it and then sums up the data in all the cells above the last cell. The problem is I want the sum to always begin at row 3, cell A3 and not cell A1, because there is a data in the first 2 rows that should not form part of this calculation. Any help in how to modify this to achieve that would be gratefully received:
Code:
Objsheet.Range("A" & LastRow + 1).FormulaR1C1 = "=SUM(R[-" & LastRow & "]C:R[-1]C)"
John