LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Sub-total questions

Hi everyone, I have some questions regarding Sub-Totals:

I have a macro to insert sub-totals on a spreadsheet with multiple columns.
I want to Sum the values in most columns, Count the values in Column 7, and
Average the values in Columns 9, 16, and 18. My code looks like this:

Selection.Subtotal GroupBy:=3, Function:=xlSum, TotalList:=Array(10, 11,
12 _
, 13, 14, 15, 17, 19, 20), Replace:=True, PageBreaks:=False,
SummaryBelowData:=True
Selection.Subtotal GroupBy:=3, Function:=xlCount, TotalList:=Array(7), _
Replace:=False, PageBreaks:=False, SummaryBelowData:=True
Selection.Subtotal GroupBy:=3, Function:=xlAverage, TotalList:=Array(9,
16 _
, 18), Replace:=False, PageBreaks:=False, SummaryBelowData:= True

However, I would like to show the Subtotal Sums, Counts, and Averages on the
same SubTotal row, not on separate rows. How can I do this? The workaround
I am currently using is to Sum all columns first, then select Column 7 and do
a search and replace on the subtotal Sum formula to change it to Count, then
use the same process to change Columns 9, 16, and 18 to Average. This seems
cumbersome, is there a cleaner way to do this?

2 follow-up questions:

1) Can I format the entire row with the Subtotals to be in bold font, as
opposed to just the row heading €śColumn 3 Total€ť being in bold?

2) Can I format the Count Sub-Total values for Column 7 to be in number
format with commas and no decimal places? The data in Column 7 is in a
Custom Format with leading zeroes, but I do not want the Count Sub-Totals to
be in that format.


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
Excel 2002 : Any single button to get sub total and grand total ? Mr. Low Excel Discussion (Misc queries) 2 May 22nd 07 08:46 AM
the total number of "Very Satisfied" questions there are YouthHelp Excel Worksheet Functions 1 September 22nd 06 09:44 PM
Total Questions Metalteck Excel Discussion (Misc queries) 2 June 22nd 05 03:27 PM


All times are GMT +1. The time now is 02:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"