+ Reply to Thread
Results 1 to 5 of 5

Need Help Updating Pivot Table Source Data

  1. #1
    Registered User
    Join Date
    02-21-2019
    Location
    STL
    MS-Off Ver
    2013
    Posts
    10

    Need Help Updating Pivot Table Source Data

    So I'm brand new to VBA and having a hard time figuring out how to use a macro to update the source data on an existing pivot table.
    I have data in columns A:AX, AX contains dates and I have the macro sort them leaving the blanks on bottom. I want the macro to select the source data from A1 to the last row containing data in AX. I want to do this without deleting the rows containing blank AX cells.

    This is what I have so far. No clue if I'm close or completely wrong.

    Please Login or Register  to view this content.
    EDIT* This pivot groups by dates and it won't let me do that if there are blanks. If I use a table it still pulls in blanks and ungroups my dates
    Last edited by walt737; 02-22-2019 at 08:36 AM. Reason: Additional info

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Need Help Updating Pivot Table Source Data

    You don't need a macro to update the source of a pivot table.

    Put the source data in a table and create the pivot. The source expands and contracts with the table.

  3. #3
    Registered User
    Join Date
    02-21-2019
    Location
    STL
    MS-Off Ver
    2013
    Posts
    10

    Re: Need Help Updating Pivot Table Source Data

    Thanks! I didn't know about using Tables. That will come in handy.

    Sorry I should have been more clear about why I want to update the source data. This pivot groups by dates and it won't let me do that if there are blanks. If I use a table it still pulls in blanks and ungroups my dates. I'm not sure if there is a workaround for that w/o updating the source data each time.

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Need Help Updating Pivot Table Source Data

    Your pivot table should allow blanks in dates and still group. Are they really blanks or maybe "" from a formula?

    You might need to attach a sample workbook.

  5. #5
    Registered User
    Join Date
    02-21-2019
    Location
    STL
    MS-Off Ver
    2013
    Posts
    10

    Re: Need Help Updating Pivot Table Source Data

    You're right. They are "" from a formula. Not sure if its the most efficient way, but I just added a line to clear contents from the AX column if the cell = "". After that the above code worked for me.

+ 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] Updating the source data of a Pivot Table
    By AhmedAbdelhai in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-28-2018, 05:13 AM
  2. Replies: 0
    Last Post: 01-06-2016, 07:00 AM
  3. Updating Pivot Source Data Automatically
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-19-2015, 02:49 PM
  4. [SOLVED] Updating data source and refreshing all pivot tables through VBA.
    By Folshot in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-26-2013, 10:01 AM
  5. [SOLVED] Problem updating source for pivot table
    By flyboy54 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2013, 12:35 PM
  6. updating pivot tables using dynamic data source
    By dab4211 in forum Excel General
    Replies: 3
    Last Post: 07-24-2006, 04:45 PM
  7. Updating source data while in Pivot Table
    By Carim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-27-2005, 10:06 AM

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