+ Reply to Thread
Results 1 to 4 of 4

Dynamic Range Pivot

  1. #1
    Registered User
    Join Date
    08-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    6

    Dynamic Range Pivot

    Hi,

    I am new to VBA.

    I have a data set from which a pivot table is created. A duplicate filter is applied on the data and then I need to copy the data to another sheet. How do I make dynamic selections? I have highlighted where I believe the data needs to be dynamic.

    Please Login or Register  to view this content.
    Last edited by fireboltpk; 05-30-2017 at 11:23 AM.

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

    Re: Dynamic Range Pivot

    Hi fireboltpk,

    Could you please edit your question by selecting all the code and clicking on the "#" icon above the message box. This will make the code much more readable.

    After you do that the answer to your question lies in Dynamic Named Ranges. You create them using the Formulas Tab => Named Manager. After you create the Dynamic Named Range you would change the line of:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    http://www.contextures.com/xlNames01.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: Dynamic Range Pivot

    If you import or copy / paste your source data into an Excel Table and then use the table as the Pivot Table source, you will not need code at all. As you add or delete information to the Excel Table, the pivot table will adjust automatically to the new range. Excel tables also "remember" and copy down formulas, validations, formats, etc.

    Here is some information on Excel Tables: http://www.utteraccess.com/wiki/Tables_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.

  4. #4
    Registered User
    Join Date
    08-11-2012
    Location
    Pakistan
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Dynamic Range Pivot

    Quote Originally Posted by MarvinP View Post
    Hi fireboltpk,

    Could you please edit your question by selecting all the code and clicking on the "#" icon above the message box. This will make the code much more readable.

    After you do that the answer to your question lies in Dynamic Named Ranges. You create them using the Formulas Tab => Named Manager. After you create the Dynamic Named Range you would change the line of:
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    http://www.contextures.com/xlNames01.html
    Thanks. I have formatted the code!

+ 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. Dynamic Range Pivot
    By Karen13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2015, 02:20 PM
  2. [SOLVED] Dynamic Range for Pivot Table
    By dinesh_ltjd in forum Excel General
    Replies: 2
    Last Post: 05-04-2013, 05:14 AM
  3. Dynamic Pivot-range (array)
    By msevland in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-25-2012, 06:14 AM
  4. Dynamic Range using Offset, range not found for Pivot
    By GoneBaja in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2012, 09:19 AM
  5. dynamic range for pivot table
    By Nike6106 in forum Excel General
    Replies: 0
    Last Post: 10-28-2008, 09:47 AM
  6. Dynamic Range in a Pivot Table
    By Chris C in forum Excel General
    Replies: 0
    Last Post: 06-27-2006, 01:15 PM
  7. [SOLVED] Dynamic Range for Pivot Table
    By Rob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2006, 03:30 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