+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    12-04-2009
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    1

    Angry (un)hide pivot table items with userform

    Hi guys,

    I have a problem with my pivot table. What I am trying to do is create a userform that allows people to input up to five customer IDs and then format the pivot table accordingly.

    I have been able to hide all pivot items, but making the requested items seems to be more problematic. The following code does work:

    Code:
      With ActiveSheet.PivotTables("PivotTable4").PivotFields("Sold-to Party")
              .PivotItems("1234567").Visible = True
        End With
    It succesfully make customer "1234567" visible. But when I try to do it by using the variable from the userform the code gives me the '1004' error. This is the code:

    Code:
       Public ComboBox1 As Integer
    
    
    
        With ActiveSheet.PivotTables("PivotTable4").PivotFields("Sold-to Party")
              .PivotItems(ComboBox1).Visible = True
        End With
    Anyone have an idea why it doesn't work like this?

  2. #2
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: (un)hide pivot table items with userform

    Hi,

    For your info, Debra has a whole set of solutions ...

    http://www.contextures.com/xlPivot03.html

    HTH

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0