View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Philip Philip is offline
external usenet poster
 
Posts: 156
Default Need pivot table to automatically highlight subtotal rows

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