Calculate the sum of rows using macro
Solved/Closed
Related:
- Which feature is used to calculate the sum of rows and columns, in excel?
- Formula to calculate vat in excel - Guide
- How to delete rows and columns in word - Guide
- Calculation is incomplete excel - Guide
- Excel mod apk for pc - Download - Spreadsheets
- How to calculate fuel surcharge - Excel Forum
1 response
Excelguru
Posts
261
Registration date
Saturday 11 April 2009
Status
Member
Last seen
21 June 2011
307
3 Jun 2009 à 03:58
3 Jun 2009 à 03:58
Hi
The problem seems to be in the line Cells(lngLastColumn + 1, lngRow).Formula = "=Sum(" & Cells(1, lngRow).Address & ":" & _
Cells(lngLastColumn, lngRow).Address & ")"
I think , here you have to use Cells(lngRow,lngLastColumn + 1).
My suggestion is to use activesheet.usedrange.rows.count instead of Range.End(xlToRight) and the like statements.
Please revert back if you have any qurties
The problem seems to be in the line Cells(lngLastColumn + 1, lngRow).Formula = "=Sum(" & Cells(1, lngRow).Address & ":" & _
Cells(lngLastColumn, lngRow).Address & ")"
I think , here you have to use Cells(lngRow,lngLastColumn + 1).
My suggestion is to use activesheet.usedrange.rows.count instead of Range.End(xlToRight) and the like statements.
Please revert back if you have any qurties
3 Jun 2009 à 05:57