Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a macro set up that creates a very generic looking pivot table, and I would like it to be able to automatically highlight the subtotal rows in yellow. Any ideas out there on how this is done. I am guessing that there is a simple solution to this, but I am having a brain fart right now.... -- jim37055 ------------------------------------------------------------------------ jim37055's Profile: http://www.excelforum.com/member.php...o&userid=27788 View this thread: http://www.excelforum.com/showthread...hreadid=493804 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to look into the object model of the Pivot Table.
here is a snippet from what we did: CODE With xlWorksheet.PivotTables("Statistics") ' sort the status codes... .PivotFields("Status Code").AutoSort xlAscending, "Status Code" .PivotSelect "'No. Of Items'", xlDataAndLabel xlApplication.Selection.Interior.ColorIndex = 19 ' format the 'Shares' count column .PivotSelect "'No. Of Items'", xlDataOnly xlApplication.Selection.NumberFormat = "#,##0_);(#,##0)" <<< END Te best way to start is to turn on the macro recorder, right-click the pivot table on the field you want rto change, and choose format cells, see if that helps. As you can see from the code above, you reference the table, then in that table, you have a collection of PivotItems and PivotFields which you can refererence and manipulate... HTH Philip "jim37055" wrote: I have a macro set up that creates a very generic looking pivot table, and I would like it to be able to automatically highlight the subtotal rows in yellow. Any ideas out there on how this is done. I am guessing that there is a simple solution to this, but I am having a brain fart right now.... -- jim37055 ------------------------------------------------------------------------ jim37055's Profile: http://www.excelforum.com/member.php...o&userid=27788 View this thread: http://www.excelforum.com/showthread...hreadid=493804 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
highlight subtotal rows with a fill color | Excel Worksheet Functions | |||
Double Pivot Table - Match Subtotal Rows | Excel Discussion (Misc queries) | |||
How do i automatically group rows in a pivot table? | Excel Discussion (Misc queries) | |||
Select all subtotal rows on Pivot Table | Excel Worksheet Functions | |||
Different Calculations in Pivot Table Subtotal Rows | Excel Programming |