Results 1 to 11 of 11

Change Pivot Data Source automatically when pulling from same page

Threaded View

  1. #1
    Registered User
    Join Date
    02-11-2013
    Location
    new york
    MS-Off Ver
    Excel 2010
    Posts
    50

    Change Pivot Data Source automatically when pulling from same page

    Hi all,

    I'm uploading a sample worksheet- on the tabs scenario A and B, the pivot table is pulling from the same relative data range that is between B3:c13. However, on the scenario B tab it is still pulling from the scenario A tab, even though I want it to be pulling from scenario B.

    I do not want to use dynamic ranges because the pivot table is being used to make a pivot chart. How do I get it so that on the scenario B tab the pivot table automatically pulls from the right tab?

    I have also have a macro/VBA (I don't know what it is considered, I'm completely clueless with regards to vba/macros, I just copied code from somewhere online) that automatically refreshes all pivot tables (there are other pivot tables being used in the spreadsheet). If I did need to use vba/macro to accomplish what I need to do, where would I copy/paste it in the code I currently have (not sure if the button I have in sample will work properly)?

    Sub Refresh()

    Dim PT As PivotTable
    Dim WS As Worksheet

    For Each WS In ThisWorkbook.Worksheets

    For Each PT In WS.PivotTables
    PT.RefreshTable
    Next PT

    Next WS

    End Sub
    Thanks! If this is confusing, please let me know and I will try to clarify.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change Pivot Source Data in multiple pivot tables
    By jacol in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 05-20-2014, 06:18 AM
  2. Replies: 2
    Last Post: 04-16-2012, 05:06 PM
  3. Replies: 3
    Last Post: 02-27-2012, 08:03 PM
  4. how to automatically change source data in a chart?
    By els_pricing_heather in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-29-2011, 10:29 AM
  5. How do I create charts that change source data automatically?
    By cbalster in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-26-2006, 03:19 PM

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