Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Pivot Tables

So I have written up some code in VBA that basically takes some sloppy input
files (system reports) and formats them, adds in some new fields for more
info and creates pivot tables. In each of the pivot tables year is the
column field. My original problem was that "blank" would appear in this
field. That was easily fixed by adding this to the code of each table
creation:

With ActiveChart.PivotLayout.PivotTable.PivotFields("Ye ar")
..PivotItems("(blank)").Visible = False
End With

Now the only problem with my fix is that if "blank" is not in the field it
will error out. Is there something similar to the below that will only make
blank visible = false if blank exists?

With ActiveChart.PivotLayout.PivotTable.PivotFields("Ye ar")
If .PivotItems("(blank").Exists = True Then
.PivotItems("(blank)").Visible = False
End If
End With
 
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
Pivot Table Data Adding contents of two pivot tables and param que Roundy Excel Discussion (Misc queries) 0 July 2nd 07 10:20 PM
Average Calculations from Pivot Tables - Get Pivot Data? Calc Fiel westy Excel Worksheet Functions 5 March 10th 07 01:31 AM
Pivot Tables -changing datasource for exsting Pivot Table kfschaefer Setting up and Configuration of Excel 0 May 30th 06 06:36 PM
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


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