Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Pivot table: how to programmatically format headers?

I've been asked to apply some formatting to a pivot table: bold and
italics for subtotals, and underline headers. After studying Debra
Dalgleish's site I learned how to apply bold italic font to the
subtotals, comme ca:

Sub Pivot_Table_Format()
Dim PT As PivotTable
Dim PF As PivotField

On Error Resume Next
For Each PT In ActiveSheet.PivotTables
'Bold, italic subtotals
For Each PF In PT.PivotFields
PT.PivotSelect PF.Name & "[All;Total]", xlDataAndLabel, True
Selection.Font.Italic = True
Selection.Font.Bold = True
Next PF
Next PT

Range("a1").Select

End Sub

How do I find and apply formatting to the headers?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Pivot table: how to programmatically format headers?

If you want to format the field buttons:

Sub Pivot_Table_Headings_Format()
Dim pt As PivotTable
Dim pf As PivotField

On Error Resume Next
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.VisibleFields
pf.LabelRange.Font.Underline = True
Next pf
Next pt

End Sub


Dave O wrote:
I've been asked to apply some formatting to a pivot table: bold and
italics for subtotals, and underline headers. After studying Debra
Dalgleish's site I learned how to apply bold italic font to the
subtotals, comme ca:

Sub Pivot_Table_Format()
Dim PT As PivotTable
Dim PF As PivotField

On Error Resume Next
For Each PT In ActiveSheet.PivotTables
'Bold, italic subtotals
For Each PF In PT.PivotFields
PT.PivotSelect PF.Name & "[All;Total]", xlDataAndLabel, True
Selection.Font.Italic = True
Selection.Font.Bold = True
Next PF
Next PT

Range("a1").Select

End Sub

How do I find and apply formatting to the headers?

Thanks



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 427
Default Pivot table: how to programmatically format headers?

That did it- thanks very much!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,979
Default Pivot table: how to programmatically format headers?

You're welcome. Thanks for letting me know that it worked.

Dave O wrote:
That did it- thanks very much!



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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
Custom field in Pivot Table? [email protected] Excel Discussion (Misc queries) 1 August 8th 06 07:20 PM
Pivot Table Format cer9 Excel Discussion (Misc queries) 1 May 30th 06 10:05 PM
Derived Columns in Pivot Table sa02000 Excel Discussion (Misc queries) 1 February 8th 06 07:18 PM
pivot table format report - setting default stevep Excel Discussion (Misc queries) 0 December 14th 05 03:26 PM
How Do You Permanently Format Fields of a Pivot Table? Marcia Excel Discussion (Misc queries) 1 December 6th 04 01:55 PM


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

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

About Us

"It's about Microsoft Excel"