Results 1 to 1 of 1

Selecting PivotItems in a PivotTable

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    105

    Selecting PivotItems in a PivotTable

           With ActiveSheet.PivotTables("PivotTable5").PivotFields("Letter Code")
            .PivotItems("A").Visible = False
            .PivotItems("B").Visible = False
            .PivotItems("C").Visible = False
            .PivotItems("D").Visible = True
            .PivotItems("E").Visible = True
        End With
    Hi I have the above code for a pivot table. Sometimes however, there are no cells with "D" in the pivottable, as a result the macros crashes at this point because it is expecting to check it off as existing in the pivottable. I was wondering if there is a way to check off TRUE only if it exists in the pivot table. Same also applies with unchecking as False only if it exists as one of the selections in the pivot table.
    Last edited by undergraduate; 03-29-2010 at 12:11 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1