Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need pivot table to automatically highlight subtotal rows


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   Report Post  
Posted to microsoft.public.excel.programming
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


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
highlight subtotal rows with a fill color Deb Raskob Excel Worksheet Functions 1 August 9th 08 06:30 PM
Double Pivot Table - Match Subtotal Rows Mathew P Bennett Excel Discussion (Misc queries) 2 August 8th 08 03:43 PM
How do i automatically group rows in a pivot table? SC Excel Discussion (Misc queries) 1 April 1st 06 09:31 AM
Select all subtotal rows on Pivot Table Marcotte A Excel Worksheet Functions 2 February 23rd 06 06:10 PM
Different Calculations in Pivot Table Subtotal Rows Hank[_5_] Excel Programming 0 April 5th 05 02:12 PM


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