+ Reply to Thread
Results 1 to 6 of 6

Refresh a date (month) on Several Pivot Tables

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Joinville, Brazil
    MS-Off Ver
    2010
    Posts
    5

    Question Refresh a date (month) on Several Pivot Tables

    Hi there,

    A created a lot of pivot tables. I tried to record a macro in order to refresh the pivot table and also the pivot graphs, but i dont know how to link a button to refresh the tables linked to a required month in a cell. The macro is shown bellow:

    Sub Atualizar()
    '
    ' Atualizar Macro
    '

    '
    ActiveSheet.PivotTables("Tabela dināmica8").PivotFields("Data").ClearAllFilters
    ActiveSheet.PivotTables("Tabela dināmica8").PivotFields("Data").PivotFilters. _
    Add Type:=xlAllDatesInPeriodSeptember
    ActiveSheet.PivotTables("Tabela dināmica1").PivotFields("Data").ClearAllFilters
    ActiveSheet.PivotTables("Tabela dināmica1").PivotFields("Data").PivotFilters. _
    Add Type:=xlAllDatesInPeriodSeptember
    ActiveSheet.PivotTables("Tabela dināmica2").PivotFields("Data").ClearAllFilters
    ActiveSheet.PivotTables("Tabela dināmica2").PivotFields("Data").PivotFilters. _
    Add Type:=xlAllDatesInPeriodSeptember
    End Sub


    If i modify the moth to another inside the macro, it works. But i want to type a specific moth in a cell a push a button to refresh.

    Thank you so much.

    Leandro

  2. #2
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Refresh a date (month) on Several Pivot Tables

    Just want to ask, but doesn't the "Refresh All" button work this? Have you tried that?
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  3. #3
    Registered User
    Join Date
    09-11-2014
    Location
    Joinville, Brazil
    MS-Off Ver
    2010
    Posts
    5

    Re: Refresh a date (month) on Several Pivot Tables

    Hi BrownBoy,

    Thank you for reply.

    No, it doesnt work.

    I have attached the file. if possible, go until the Plan11, you are gonna see what i mean. There are 12 pivot tables and each one has a pivot graph. I want to refresh all the tables, just typping a required month in the cell C5, and push the button refresh to update.

    Planilha de controle - TESTE MACRO - Leandro VBA 2.zip

    Thanks again.

    Leandro

  4. #4
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Refresh a date (month) on Several Pivot Tables

    What it sounds like you want is a quick way to filter your data by what month is typed into the box in Sheet "Plan11". If this is what your after, it would be more efficient to incorporate pivot table slicers into your workbook.

    See the attached. I highlighted the cells I changed or added in yellow. Not major changes, but helped me. The file was too big so I deleted the sheets that I did not need in order to get my point across. This is the best I have to offer, I couldn't come up with the code, maybe someone else can help you with that.

  5. #5
    Registered User
    Join Date
    09-11-2014
    Location
    Joinville, Brazil
    MS-Off Ver
    2010
    Posts
    5

    Re: Refresh a date (month) on Several Pivot Tables

    Hi BrownBoy,

    Thank you again.

    I have an old version (2007) in my own computer. I will try to make what you said in my work computer on monday, there is a 2010 version. I will keep you updated what happens.

  6. #6
    Registered User
    Join Date
    09-11-2014
    Location
    Joinville, Brazil
    MS-Off Ver
    2010
    Posts
    5

    Re: Refresh a date (month) on Several Pivot Tables

    Hi BrownBoy,

    I have tested the workbook. It's enough. Perfect!

    Thank you for help.

    Best regards.

    Leandro

+ 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. Refresh Pivot Tables
    By jewels3059 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-03-2013, 04:30 AM
  2. Refresh All Pivot Tables
    By smyuen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-28-2012, 10:05 PM
  3. Refresh pivot tables
    By rhyan66 in forum Excel General
    Replies: 3
    Last Post: 09-16-2010, 11:52 AM
  4. Retrieving data from two pivot tables based on date (grouped by month and year)
    By TheCyrusVirus in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-05-2010, 04:37 AM
  5. Refresh Pivot Tables
    By kaoscore in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-09-2006, 03:21 AM

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