Results 1 to 2 of 2

Thread: EXPORT THEN REFRESH AUTOMATICALLY THE PIVOT TABLE

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Banned
    Join Date
    May 2013
    Posts
    17
    Rep Power
    0

    EXPORT THEN REFRESH AUTOMATICALLY THE PIVOT TABLE

    Hello there!

    Can you help me in exporting a file when exported, the pinot table in the summary sheet will automatically refresh to have the details.

    Here's the partial code.

    Code:
    Sub Export()
    
        Dim Keyword As String
        
        Keyword = UCase$(Worksheets("INSTRUCTIONS").Range("O24").Value)
        
        Application.DisplayAlerts = False
        
        Select Case Keyword
            Case "RNAM"
                Sheets(Array("CLASSIFIED-RNAM", "SUMMARY-RNAM")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
            
            Case "RECA-RWCE"
                Sheets(Array("CLASSIFIED-RECA-RWCE", "SUMMARY-RECA-RWCE")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
            
            Case "RRR"
                Sheets(Array("CLASSIFIED-RRR", "SUMMARY-RRR")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
                
            Case "RASO-RNEA"
                Sheets(Array("CLASSIFIED-RASO-RNEA", "SUMMARY-RASO-RNEA")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
                
            Case "SWEDEN"
                Sheets(Array("CLASSIFIED-SWEDEN", "SUMMARY-SWEDEN")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
                
            Case "RLAM"
                Sheets(Array("CLASSIFIED-RLAM", "SUMMARY-RLAM")).Copy
                With ActiveWorkbook
                    .Title = "Classified"
                    .Close True
                End With
                
        End Select
        Application.DisplayAlerts = True
    
    End Sub
    The only thing missing in the code is the refreshing of pivot tables during exports.

    Thanks!

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    You can use this code to refresh all pivot tables in a workbook. Surely, you can make the modification as per your need.

    Code:
    ActiveWorkbook.RefreshAll
    OR
    Code:
    Workbooks(1).RefreshAll
    OR
    Code:
    Workbooks("Name Of Workbook.xls").RefreshAll
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Export data from Excel to Access Table (ADO) using VBA
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 4
    Last Post: 02-24-2015, 07:53 PM
  2. Create a Pivot table
    By NITIN SHETTY in forum Excel Help
    Replies: 3
    Last Post: 01-26-2013, 11:01 AM
  3. Lookup and Count Using Pivot Table
    By RobExcel in forum Excel Help
    Replies: 2
    Last Post: 12-21-2012, 11:08 AM
  4. Pivot Table Count No of Items per Category
    By Howardc in forum Excel Help
    Replies: 2
    Last Post: 07-04-2012, 10:49 PM
  5. Filter more than one pivot table at one time
    By larryt1940 in forum Excel Help
    Replies: 8
    Last Post: 05-04-2012, 06:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •