+ Reply to Thread
Results 1 to 7 of 7

Change Pivot table range depending on selection

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Change Pivot table range depending on selection

    Hi guys,

    I hope someone can assist.. this should be pretty easy I think, though despite my best efforts i cant do it..


    I need an already created Pivot table to dynamically change from "Range2010" to "Range2011" (they are defined) whenever the user switches the year from a drop down box.

    The pivot table is on the "Graphs" worksheet.. should be pretty easy to work out what needs to happen from the example in the attached document.

    Thanks so much in advance guys... Sars
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Change Pivot table range depending on selection

    Hi Sarah,

    It looks like you need to do a simple change the pivot table's data source from one named range to another.
    That will take a little VBA.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Change Pivot table range depending on selection

    Hi,

    Yeh I agree. I just wrote this... for some reason the database sources arent flicking over though...

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Change Pivot table range depending on selection

    Probably isnt change because I am referencing a defined name the wrong way.. just not sure of the right way...

  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Change Pivot table range depending on selection

    Just tried this code though it didnt refresh again.. im obviously missing something,.. please help, pretty please.

    Sars

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Change Pivot table range depending on selection

    this didnt work either...

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    209

    Re: Change Pivot table range depending on selection

    Did it! "your silence helped"

+ Reply to Thread

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