Results 1 to 10 of 10

Radio buttons do not return correct data from pivot table.

Threaded View

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    Waco TExas
    MS-Off Ver
    Excel 2003
    Posts
    29

    Radio buttons do not return correct data from pivot table.

    I have a pivot table containing the following data elements:

    EAST.01.07.01
    NORTH_HPAJ
    SOUTH_HPAJ
    WEST.01.06.1
    WEST.01.06.1.2
    WEST.01.09.1.2

    I have 4 option buttons labeled NORTH, SOUTH, EAST, and WEST. As you can see, WEST is comprised of 3 elements, but all these elements are not useful to the user. Only WEST.01.06.1 should be seen by the user. My VBA code is not written to properly return the data. When I choose any of the option buttons, they all return the excess data from WEST. This is just a very simplified explanation, because in reality there will be dozens of unused elements that I don't want to show up. I've attached the relevant spreadsheet. Also, here is my code. I appreciate any help. Thanks and have a blessed day.


    Private Sub test()

    Set sh = ActiveSheet

    On Error Resume Next
    Application.ScreenUpdating = 0

    With Sheets("DETAILS").PivotTables(1).PivotFields("Element")

    .ClearAllFilters

    .PivotItems("NORTH_HPAJ").Visible = sh.OptionButtons(1).Value = 1
    .PivotItems("SOUTH_HPAJ").Visible = sh.OptionButtons(2).Value = 1
    .PivotItems("WEST.01.06.1").Visible = sh.OptionButtons(4).Value = 1
    .PivotItems("EAST.01.07.01").Visible = sh.OptionButtons(3).Value = 1


    End With

    Application.ScreenUpdating = 1

    End Sub
    Attached Files Attached Files

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