Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot table custom formatting of group levels

Is it possible to assign a different formatting for each RowField in a Pivot
table without using the built-in autoformats in Excel?
f.i. One wants a report with the revenues per city, per state. Now it is
desired to make the row with names of the state and its revenues pink and
the row with city names and revenues blue.

I have investigated the interfaces in the Excel type library and searched de
MSDN documentation on it, but all I can achieve is to format the pivot table
regions through commands such as:
With ActiveSheet.PivotTables(1)
.HasAutoFormat = False
.TableRange1.Style = "Test"
.DataBodyRange.Style = "Test2"
.RowRange.Style = "RowStyle"
.ColumnRange.Style = "ColumnStyle"
End With

Although these properties seem to be promising, it just formats all the
rowfields and not the data, neither is it possible to apply different
formatting to group levels. You end up with a pivot table that is pink on
the left and white on the right. This does not help to clarify the groupings
in the report.

So I start to wonder if it is possible to reproduce a report with a style
and formatting similar to the built-in autoformats in Excel?




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Pivot table custom formatting of group levels

Hi Danny

Check out the PivotSelect method in Excel VBA help. Turn
on the recorder and do it manually. It will give you a
framework to modify.

You'll need code something like this:

ActiveSheet.PivotTables("PivotTable2").PivotSelect "CITY
[All]", xlDataOnly
With Selection.Interior
.ColorIndex = 24
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ActiveSheet.PivotTables
("PivotTable2").PivotSelect "STATE[All;Total] DOLLARS", _
xlDataAndLabel
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With

Mike

-----Original Message-----
Is it possible to assign a different formatting for each

RowField in a Pivot
table without using the built-in autoformats in Excel?
f.i. One wants a report with the revenues per city, per

state. Now it is
desired to make the row with names of the state and its

revenues pink and
the row with city names and revenues blue.

I have investigated the interfaces in the Excel type

library and searched de
MSDN documentation on it, but all I can achieve is to

format the pivot table
regions through commands such as:
With ActiveSheet.PivotTables(1)
.HasAutoFormat = False
.TableRange1.Style = "Test"
.DataBodyRange.Style = "Test2"
.RowRange.Style = "RowStyle"
.ColumnRange.Style = "ColumnStyle"
End With

Although these properties seem to be promising, it just

formats all the
rowfields and not the data, neither is it possible to

apply different
formatting to group levels. You end up with a pivot table

that is pink on
the left and white on the right. This does not help to

clarify the groupings
in the report.

So I start to wonder if it is possible to reproduce a

report with a style
and formatting similar to the built-in autoformats in

Excel?




.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Pivot table custom formatting of group levels

Hi Mike,

Thanks for your response. Your suggestion seems to open up a lot of new
possibilities.

Danny.


"MikeW" schreef in bericht
...
Hi Danny

Check out the PivotSelect method in Excel VBA help. Turn
on the recorder and do it manually. It will give you a
framework to modify.

You'll need code something like this:

ActiveSheet.PivotTables("PivotTable2").PivotSelect "CITY
[All]", xlDataOnly
With Selection.Interior
.ColorIndex = 24
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
ActiveSheet.PivotTables
("PivotTable2").PivotSelect "STATE[All;Total] DOLLARS", _
xlDataAndLabel
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With

Mike

-----Original Message-----
Is it possible to assign a different formatting for each

RowField in a Pivot
table without using the built-in autoformats in Excel?
f.i. One wants a report with the revenues per city, per

state. Now it is
desired to make the row with names of the state and its

revenues pink and
the row with city names and revenues blue.

I have investigated the interfaces in the Excel type

library and searched de
MSDN documentation on it, but all I can achieve is to

format the pivot table
regions through commands such as:
With ActiveSheet.PivotTables(1)
.HasAutoFormat = False
.TableRange1.Style = "Test"
.DataBodyRange.Style = "Test2"
.RowRange.Style = "RowStyle"
.ColumnRange.Style = "ColumnStyle"
End With

Although these properties seem to be promising, it just

formats all the
rowfields and not the data, neither is it possible to

apply different
formatting to group levels. You end up with a pivot table

that is pink on
the left and white on the right. This does not help to

clarify the groupings
in the report.

So I start to wonder if it is possible to reproduce a

report with a style
and formatting similar to the built-in autoformats in

Excel?




.



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
Pivot table chart problem, How to show different subtotal levels Ycorth Charts and Charting in Excel 2 March 12th 10 01:36 PM
Pivot Table group levels Bunji Excel Discussion (Misc queries) 3 October 15th 08 06:48 PM
Pivot table totals in low levels of hierarchy Nir Excel Discussion (Misc queries) 0 October 16th 07 10:39 AM
Pivot Table For Running Inventory Levels GarrettD78 Excel Discussion (Misc queries) 0 May 15th 07 06:26 PM
Pivot table custom formatting of group levels DannyG Excel Programming 0 February 16th 05 01:59 PM


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