LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Manipulate pivot tables in VBA

Hi all,

I have a pivot table that I have to work with every day, and I was
hoping to automate a couple of things with VBA code. I have most of it
solved, except one thing. So I was hoping for some help here.
Is it possible to hide rows with the data 0?

So let's say that we have a list of customers (customers in the rows)
and revenue in the data section, and I want to "hide" the customers
with 0 revenue. There is something in the columns, so it needs to be
applied to the row total. There are two fields in the data section
(revenue and qty) and I want to hide the rows if it has 0 as revenue,
even if there will be a volume in the second data field.
And to make it even more complicated, it is according to the current
selection. There are selections in the page section, so in total the
revenue might be something else, but it is if the row total for the
current selection is 0 that I want to hide the item.


Product: "Selected product 1"

Month 1 Month 2 Total
Revenue Volume Revenue Volume Revenue Volume
Customer 1 2 000 11 3 000 17 5 000 28
Customer 2 1 000 4 2 000 8 3 000 12
Customer 3 0 1 0 0 0 1
Customer 4 0 0 0 0 0 0

In this case I want to not hide Customer 3 and 4 in the pivot table.

I have made a PT object (as pivot table) and two variables t and i (as
Integer)

With PT
With .PivotFields("Customer Name")
t = .PivotItems.Count
Debug.Print t 'About 8 000 names now

For i = 0 To t

'Hide item if row total for data "Revenue" is 0

Next i

End With


End With


Thanks in advance for any help.

Ronny

 
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
Building pivot tables in Excel 2007 based on existing pivot tables? [email protected] Excel Discussion (Misc queries) 4 December 26th 07 08:05 PM
Can't manipulate pivot table Grrffin Excel Discussion (Misc queries) 1 November 17th 05 05:08 AM
How does the term 'pivot' apply to Excel's Pivot tables and Pivot. stvermont Excel Discussion (Misc queries) 1 February 17th 05 01:34 AM
How do I manipulate pivot table report to include percentage of? KRUEMJ-Needs some help Excel Discussion (Misc queries) 2 January 31st 05 01:06 AM
Pivot tables-controlling user interaction with pivot tables Sindhura Excel Programming 0 August 27th 03 02:10 PM


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