+ Reply to Thread
Results 1 to 2 of 2

Breaking a Pivot into multiple sheets, and then into multiple workbooks (using VBA)

  1. #1
    Registered User
    Join Date
    07-01-2018
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    1

    Breaking a Pivot into multiple sheets, and then into multiple workbooks (using VBA)

    Hi all, apologies if this has been asked elsewhere and I missed it.

    I'm trying to write a macro to automate the production of reports from a single source file, all of which then need to be sent to individuals for expense-claiming purposes.

    I've successfully automated the process to the point of generating a pivot table which is then split to multiple tabs. However, I'm stuck with progressing things further. I have written a script that successfully removes the pivot from each tab, leaving only the raw data formatted into tables. However, the script only works on one tab at a time when I manually run it; when I try to make it loop through all tabs on the active workbook, Excel crashes horribly. There will typically be around roughly 100 tabs. I haven't even started on the part of the script that exports each tab to separate files!

    Is there a better way of doing this, or is my code just horribly optimised?


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Breaking a Pivot into multiple sheets, and then into multiple workbooks (using VBA)

    You're looping through all the sheets. I'm assuming some of them don't have pivot tables (like the data sheet). This will test if the sheet has a pivot table..

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. Copy Paste Values from multiple workbooks to multiple sheets in one workbook
    By tatendamark in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2017, 09:54 AM
  2. Macro to find and update information across multiple sheets and multiple workbooks
    By maxhecht2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2016, 11:35 AM
  3. Replies: 1
    Last Post: 09-23-2014, 06:42 PM
  4. Excel 2007 - Combine Multiple Workbooks into one Workbook Multiple Sheets
    By mab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2014, 02:48 PM
  5. multiple workbooks, multiple sheets, all same layout. scan all into master workbook
    By tlgdesign in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2014, 05:27 PM
  6. Replies: 0
    Last Post: 07-29-2013, 03:00 AM
  7. Breaking up one sheet into multiple sheets by a row identifier (mgr name)
    By Cullen8 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-10-2012, 06:59 PM

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