Grouping Question

rockatubc

New Member
Joined
Jan 28, 2005
Messages
19
Hi,

How can I sum a column up that changes according to what I group and what I do not group?

Thanks
 
How would I change the above module if I wanted to sum it up horizontally....thank you for you patience...i'm still trying to learn
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I made a small change to the code so it works horizontally too. New code:
Code:
Function SUBTOTAL_VIS(Target)
   Dim X As Double
   Dim c As Range
   Application.Volatile
   X = 0
   For Each c In Target
      If c.RowHeight = 0 Or c.ColumnWidth = 0 Then
         X = X
      Else
         X = X + c.Value
      End If
   Next c
   SUBTOTAL_VIS = X
End Function
This is the row with the change:
If c.RowHeight = 0 Or c.ColumnWidth = 0 Then (was If c.RowHeight = 0 Then)

To change, copy ALL the code and paste it over the original version.

Denis
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,819
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top