Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Formatting SubTotals


How do I format just my subtotals (created using Subtotals
method) so that they are in bold font?
I posted a similar question earlier but did not receive a
reply.
Have sussed the ClearOutline method by using
ActiveSheet.UsedRange.Select to ensure I select all my
data not just a subset of the range.
Any help with formatting is appreciated.
Many thanks
Jacqui
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Formatting SubTotals

Posted to the newsgroup with email copy (due to posting being 5 days old)...

Here's a neat trick that I picked up some time back. You can use the
Styles collection to format a Subtotaled selection.

Within Excel:
- Subtotal a worksheet
- Select the subtotaled range, then Data - Group & Outline - Settings
- Click Apply Styles. This will add at least two custom Styles to the
Styles collection. These are named RowLevel_1, RowLevel_2, etc.
RowLevel_1 corresponds to the Grand Total row; RowLevel_2 to the
first level subtotals, etc.
- You can then modify the style to achieve the desired formatting.
Format - Style, select RowLevel_1, then Modify.
- Note that Styles is a workbook level collection, so if you apply styles
to multiple subtotaled ranges, and then modify the formatting, it will
be applied to each of them.

The VBA coding I use for this functionality is:

With ActiveSheet
.UsedRange.Subtotal GroupBy:=2, Function:=xlSum, TotalList:=Array(7)
.UsedRange.ApplyOutlineStyles
.Outline.ShowLevels RowLevels:=2
End With

With ActiveWorkbook
.Styles("RowLevel_1").Font.Bold = True
.Styles("RowLevel_2").Font.Bold = True
End With

Hope this helps,
James dot Becker at NCR dot com
~
~
~
:wq!

"jacqui" wrote in message
...

How do I format just my subtotals (created using Subtotals
method) so that they are in bold font?
I posted a similar question earlier but did not receive a
reply.
Have sussed the ClearOutline method by using
ActiveSheet.UsedRange.Select to ensure I select all my
data not just a subset of the range.
Any help with formatting is appreciated.
Many thanks
Jacqui



Reply
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
Formatting a table with subtotals rabiddogg Excel Discussion (Misc queries) 0 March 28th 08 07:48 PM
Formatting subtotals? Carl Excel Worksheet Functions 1 October 6th 06 01:39 PM
Formatting Subtotals Dedrie Excel Worksheet Functions 2 August 19th 05 07:17 AM
Formatting Subtotals slh Excel Discussion (Misc queries) 1 May 13th 05 01:26 PM
formatting subtotals S. H. Drew Excel Discussion (Misc queries) 0 March 10th 05 04:05 PM


All times are GMT +1. The time now is 06:26 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"