|
-
Dec 21st, 2005, 07:57 AM
#1
Thread Starter
Lively Member
Customizing subtotals in Excel
Hi everyone, I have an Excel form written in vb that adds data onto a sheet.
How do I get subtotals automatically added to the sheet at the end of each month?
Thanks
Last edited by thelocaluk; Dec 21st, 2005 at 08:43 AM.
-
Dec 21st, 2005, 09:17 AM
#2
Frenzied Member
Re: Customizing subtotals in Excel
This is Excel VBA ... I hope it helps ...
Code:
Option Explicit
Sub Macro1()
Dim aRange As Range
'The range to apply subtotals can be calculated programmatically
Set aRange = Range("A1:C14")
'Turn On Subtotals in the range
'This groups on Column A ... figure it out by Recording a macro to do what you want.
aRange.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Dec 21st, 2005, 09:53 AM
#3
Thread Starter
Lively Member
Re: Customizing subtotals in Excel
Thanks for your reply Webtest, I can see how that works but how do I get it to subtotal at the end of each month only?
-
Dec 21st, 2005, 10:13 AM
#4
Frenzied Member
Re: Customizing subtotals in Excel
I don't understand what you are getting at. Do you mean that you don't want the Grand Total row ... ony the Monthly Subtotal rows? If that is the case, you will have to do the Subtotal operation, and then search for and delete the "Grand Total" row.
As far as I know, there is no way to prevent the Grand Total row from being created.
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|