A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

pivot table show items with a value



 
 
Thread Tools Display Modes
  #1  
Old March 16th 09, 02:26 PM posted to microsoft.public.excel.programming
wynnyderpooh
external usenet poster
 
Posts: 6
Default pivot table show items with a value

using the code below I have two issues:
1)items with a zero $ value display
2)in the drop-down the selection boxes are not updated
Thanks in advance for your help!

Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
On Error Resume Next
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.RowFields
pf.AutoSort xlManual, pf.SourceName
For Each pi In pf.PivotItems
pi.Visible = True
Next pi
pf.VisibleItems = True
pf.AutoSort xlDescending, pf.Value
Next pf
Next pt

wynnyderpooh
  #2  
Old March 16th 09, 03:51 PM posted to microsoft.public.excel.programming
ryguy7272
external usenet poster
 
Posts: 2,836
Default pivot table show items with a value

Why don't you record a macro and filter out the zeros. I just did it and got
something like this:

With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Total")
.PivotItems("$0.00").Visible = False
End With

Obviously, it will be slightly different for you!

To update the Pivot Table, right click somewhere in the area off the table
and click Refresh Data!

For some great information look he
http://www.contextures.com/xlPivot03.html
http://blog.contextures.com/archives...excel-toolbar/

Regards,
Ryan---


--
RyGuy


"wynnyderpooh" wrote:

> using the code below I have two issues:
> 1)items with a zero $ value display
> 2)in the drop-down the selection boxes are not updated
> Thanks in advance for your help!
>
> Dim pt As PivotTable
> Dim pf As PivotField
> Dim pi As PivotItem
> On Error Resume Next
> For Each pt In ActiveSheet.PivotTables
> For Each pf In pt.RowFields
> pf.AutoSort xlManual, pf.SourceName
> For Each pi In pf.PivotItems
> pi.Visible = True
> Next pi
> pf.VisibleItems = True
> pf.AutoSort xlDescending, pf.Value
> Next pf
> Next pt
>
> wynnyderpooh

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pivot table - show items with no data gt Excel Discussion (Misc queries) 0 March 30th 09 07:09 PM
Show Pivot Table Items That Have No Data J Austin Excel Discussion (Misc queries) 0 October 12th 08 05:30 PM
Pivot table-show all grouped items sergv Excel Discussion (Misc queries) 1 September 5th 05 07:18 PM
Pivot Table - show items with no data HJM Excel Discussion (Misc queries) 3 June 22nd 05 12:51 PM
Code to Show All Pivot Table Items Chris Excel Programming 1 December 13th 03 06:33 PM


All times are GMT +1. The time now is 01:14 AM.


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