+ Reply to Thread
Results 1 to 3 of 3

Macro to change Pivot Data to new sheet, where sheet name will change

  1. #1
    Registered User
    Join Date
    11-05-2008
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    67

    Macro to change Pivot Data to new sheet, where sheet name will change

    Hi Folks,

    I have a spreadsheet that includes a number of Pivots that require changeing the Pivot Table data on a daily basis to another sheet, this gives a daily variance to two pivot tables.

    I have found a few examples of how to chagne to source to a new database, but i have been unable to change that to what I need.

    Currently the code fails at PivotSource = with object required.

    any assistance provided would be helpful thanks in advance

    Please Login or Register  to view this content.
    Last edited by sarails; 12-10-2010 at 12:10 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Macro to change Pivot Data to new sheet, where sheet name will change

    Can you not used named ranges to define the pivot data sources?

    The you only need to update the named range and refresh the pivot table.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-05-2008
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    67

    Re: Macro to change Pivot Data to new sheet, where sheet name will change

    after spending "way too much time" on this

    I have come up with the following code that accomplishes what Andy said I should do - use a defined name to change the data for the Pivot.

    Whilst not pretty it does allow for what I need to happen, pivots change the data source based on the day of the week, as the sheet name changes every business day

    Please Login or Register  to view this content.

+ 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