Results 1 to 3 of 3

Change Pivot Table Data Source based on Dynamic Range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-24-2012
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2007
    Posts
    113

    Change Pivot Table Data Source based on Dynamic Range

    I have a workbook which fires off a series of macros, but I just realized that my Pivot Tables don't update properly as the source worksheet/tab is constantly changing in terms of number of rows that need to be referenced.


    So basically, the source sheet named: "S_Detail" can vary in terms of rows (can go up or down), but will always have the same number of columns
    The sheet with the Pivot Tables, "PT_Count" contains 3 pivot tables that all need to reference the entirety of the "S_Detail" sheet.

    Rather than clicking on each of the 3 pivot tables in "PT_Count", going to Options > Change Data Source > and changing my range (with respect to number of rows in the "S_Detail" sheet), how would I do this through VBA to capture an ever-moving dynamic range in "S_Detail"?

    By the way, the 3 pivot tables in "PT_Count" are:
    PivotTable3
    PivotTable5
    PivotTable6

    I've tried a few different methods, but I'm coming up with errors.

    Any help would be greatly appreciated!
    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. [SOLVED] Change Pivot Table Data Source to range A7: last record in F column
    By johnstevens in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-09-2014, 08:35 AM
  2. Macro to change pivot table range after importing new source data
    By kevinm3u in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-07-2014, 12:27 PM
  3. Replies: 4
    Last Post: 06-25-2012, 03:25 PM
  4. Update Pivot table using a dynamic range for source data
    By Carl Thompson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-02-2011, 08:20 AM
  5. Change the range of a pivot table data source
    By Tony White in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2005, 03: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