Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 5th, 2003, 07:22 PM
Registered User
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default PivotTable Column won't go Invisible

I have a pivot table in Excel 2000 based on an OLAP cube.
There is one field on the column of the PT
called "StoreName". There are 20 StoreNames on the cube
but I want only 5 to appear on the PT.

When I build this PT, all 20 come over from the cube. I
was anticipating that the visible property of the
PivotItem object might allow me to see only the StoreNames
I want by setting the others invisible with something like
this:

'pt is the pivot table
Dim pf as PivotField
Dim pi as PivotItem
For Each pf In pt.VisibleFields
 If pf.Orientation = xlColumnField Then
  For Each pi In pf.PivotItems
   If Left(pi.name,1) = "N" Then
    pi.Visible = False
   End If
  Next
 End If
Next

I get "Run-time error 1004. Application-defined or object-
defined error" at this line: pi.Visible = False.

This works if the PT source is something besides a cube.
I'm hoping you might know how to do this for a cube.

Thanks,
Stoney





Similar Threads
Thread Thread Starter Forum Replies Last Post
visible/invisible stealthdevil Access VBA 4 December 1st, 2006 05:40 PM
pivottable form Vince_421 Access VBA 2 May 26th, 2006 07:52 AM
Underscore to be invisible jmaronilla Beginning PHP 2 September 15th, 2004 09:37 AM
PivotTable programming Ray Pinnegar Access 0 April 26th, 2004 11:22 AM
Invisible HyperLink acko ASP.NET 1.x and 2.0 Application Design 2 January 19th, 2004 01:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.