MrExcel Publishing
Your One Stop for Excel Tips & Solutions

VBA - sum every other row

Posted by Mindy on May 30, 2001 3:44 PM

I have a macro which will return the resultset and display the data on the worksheet as following:

row(colume A) value(colume B)
user1 - Vol 10
user1 - Amt 20
user2 - Vol 30
user2 - Amt 40
user3 - Vol

It generates two rows for each user, Vol and Amt.
Total users will depend on the return of the recordsets.

If I need to sum the Vol and sum the Amt, what will be the formula?

The result I am looking for:
total Vol = 40
total Amt = 60

Thank you very much for helping

Posted by Russell on May 30, 2001 4:08 PM


I made an add-in that has a function called SUMALT that will sum the alternate cells in the range you specified (rows or columns, provided you have a range that has one row and multiple columns or one column and multiple rows). If you would like me to send it to you, email me (click on my name) and I'll send it back to you.


Posted by Mindy on May 31, 2001 5:57 AM


Quick question regarding the add-in you made.
The macro I use for the Excel spreadsheet will be used by multiple users,
will all of them have to install the add-in on their desktop if I add the add-in functionality on the macro?

Thank you very much

Posted by Russell on May 31, 2001 8:25 AM

If they wanted to update the formula, yes. If they just need to see the results, no.