+ Reply to Thread
Results 1 to 2 of 2

VBA to get change data source of pivot range from old to new range

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    washington
    MS-Off Ver
    Excel 2019
    Posts
    168

    VBA to get change data source of pivot range from old to new range

    Dear experts

    I have N number of workbooks in target folder in that sheet Pro! contains pivottable4 which range of data source not reset from old data range i want reset old data range to new data range of data sheetRPT25!...

    like if Old Datasource A1:4500 i want to change through vba as A1 till end data end.

    Path is D:\Mac\Forum\4-2-2016

    pls find the attachment
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: VBA to get change data source of pivot range from old to new range

    If I understand you correctly, if you add more data beyond row 4500 you want the spreadsheet to acknowledge it.

    If this is your requirement, change the range on _RPT25 to an Excel Table and then make the table your data source. Tables know exactly how many rows they have and any pivot table or formula that addresses them does not have to be changed when the range of the data changes.

    See this article on Excel Tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change chart source data range
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2015, 10:51 AM
  2. Change Pivot Table Data Source based on Dynamic Range
    By hamidxa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2014, 04:46 PM
  3. [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
  4. 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
  5. Replies: 4
    Last Post: 06-25-2012, 03:25 PM
  6. Pivot Table : Can't change source range
    By RED Rose in forum Excel General
    Replies: 0
    Last Post: 08-30-2010, 03:08 PM
  7. [SOLVED] 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