+ Reply to Thread
Results 1 to 2 of 2

Copy entire Pivot table from one workbook to another

Hybrid View

CHanley Copy entire Pivot table from... 12-15-2011, 12:16 PM
CHanley Re: Copy entire Pivot table... 12-15-2011, 02:52 PM
  1. #1
    Registered User
    Join Date
    12-15-2011
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Copy entire Pivot table from one workbook to another

    Hello,

    i am a very new VBA writer in Excel. any help is greatly appreciated.
    what i am trying to do is copy an entire pivot table from one workbook, and paste it into another. this is a subset of the entire macro i am trying to execute, but i compartmentalised it to break out this error: "Subscript out of range". i dont know what this means since i am unhiding all the rows that the pivot table is occupying. i have opened all of the workbooks in the code prior to running this set of code. i wrote most of this based on the Record Macro function in Excel 2010

    Please HELP!

    this is the code:

    Sub CopySummaryPivot()
    'need to copy the summary pivot & paste into FY12 Q4 Data > 'Pivot' $A$1
        Workbooks("CurrentFinRep.xls").Activate
        Sheets("Summary").Activate
        Rows("11:13").Select
        Selection.EntireRowHidden = False
        ActiveSheet.PivotTables("FCST_PivotSummary").PivotSelect "", xlDataAndLabel, _
            True
        Application.CutCopyMode = False
        Selection.Copy
        Workbooks("FY12 Q4 Data.xlsm").Activate
        Sheets("Pivot").Activate
        Range("$A$1").Activate
        ActiveSheet.Paste
    
    End Sub

  2. #2
    Registered User
    Join Date
    12-15-2011
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Copy entire Pivot table from one workbook to another

    Nevermind, i figured out what the issue was. i was writing the code in the sheet instead of the Module of the workbook. newbie mistake

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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