Sub Total

PMARI

New Member
Joined
Jun 10, 2011
Messages
42
Hi Freinds,

I need a macro to SUBTotal column "C" Balances. Already a blank Row provided,Based on column value "Age"

NAME- AMT- BALANCES- Age
SUPER- 5101- 102 - 190
PREMIER- 4924 - 4924- 187
- - - Total

PREMIER- 93880.8- 93880.8 - 98-
- - -Total

PREMIER- 75709.92- 75709.92- 36
PRECT- 4817.28- 4817.28- 4
- - - Total

Please anybody helpout.

Regards,PM
 
Last edited:

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Maybe you can use the command Subtotal withour using a macro...
Which excel version do you use?

Bye
 
Upvote 0
Maybe you can use the command Subtotal withour using a macro...
Which excel version do you use?

Bye
Hi,

Myself using 2007. Subtotal can take only changes in the value, it may not total when a balnk cell found in a column row.
 
Upvote 0
Then you could try this macro:
Code:
Sub sbtc()
J = 2
For I = 2 To Cells(Rows.Count, "C").End(xlUp).Row + 1
    If Cells(I, "D") = "" Then
        If Cells(I - 1, "A").Value <> "" Then Cells(I, "C").Formula = "=SUM(R[-1]C:R[" & (J - I) & "]C)"
    J = I + 1
    End If
Next I
End Sub
It scans column D, from row 2 downward, and when an empty cell is found a formula is set in column C to calculate the block subtotal, provided that col A is not empty.

Bye.
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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