+ Reply to Thread
Results 1 to 1 of 1

Please help with Macro - select all pivot items (financial figures) then deselect zero "o"

  1. #1
    Registered User
    Join Date
    02-26-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Question Please help with Macro - select all pivot items (financial figures) then deselect zero "o"

    Hi everyone

    This is my first attempt to write a VBA code as I have no prior experience and i would much appreciate your help and guidance!!

    I am working with a pivot table that has 3 filters on it. I am interested that for one of the filters which refers to some figures to automatically select all figures and then deselect zero as I am calculating an average and the "0" figure will distort the calculation.

    The actual pivot table is linked to a slicer and the slicer to various graphs. Every time I select a different product from the slicer the pivot table will obviously refresh and add new data to my pivot table. Hence I need a macro where it would automatically make sure that all data is re-selected and then de-select the zero.

    Below all I wrote so far but I get an error message saying I need to assign object?



    Sub ShowAllItemsOfPivotTable()

    With ActiveSheet.PivotTables("PivotTable1").PivotFields("Financials 2")
    PivotItem.Visible = True
    Select Case PivotItem.Name
    Case "0"
    PivotItem.Visible = False
    End Select

    End With

    End Sub



    I have attached the document for your reference.

    Thank you in advance for any help you may provide!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Disable "Select Multiple Items" in Pivot Table
    By bwolsky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2014, 06:19 PM
  2. Disable "Select Multiple Items" in a Pivot Filter
    By FixandFoxi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2013, 06:19 AM
  3. Uncheck "Select Multiple Items" in a Pivot Table Using Code (Excel 2007)
    By delecto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2009, 12:41 PM
  4. Disable "Select Multiple Items" in Pivot Table
    By Pasha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-12-2005, 08:05 PM

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.6.0 RC 1