Calculate the sum of rows using macro
Solved/Closed
Related:
- Which feature is used to calculate the sum of rows and columns, in excel?
- How to feature channels on youtube - Guide
- How to calculate vat in excel - Guide
- Excel date format dd.mm.yyyy - Guide
- Number to words in excel - Guide
- How to enable vba in excel - Guide
1 reply
Excelguru
Posts
261
Registration date
Saturday April 11, 2009
Status
Member
Last seen
June 21, 2011
307
Jun 3, 2009 at 03:58 AM
Jun 3, 2009 at 03:58 AM
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
Jun 3, 2009 at 05:57 AM