Closed Thread
Results 1 to 9 of 9

Split pairs of worksheets to separate workbooks

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    25

    Split pairs of worksheets to separate workbooks

    Greetings,

    I have a workbook with multiple worksheets as follows: RawData; Report1; Report2; Report3, etc.. where each ReportX worksheet is built using data from the RawData worksheet.

    I would like to create multiple workbooks for each ReportX worksheet, INCLUDING the RawData worksheet.

    I found code to split single worksheets to multiple workbooks, but not for inclusion of a second sheet...

    Thank you!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Split pairs of worksheets to separate workbooks

    Post the code you plan to use to split the sheets (already edited and ready for your use) and we can show the line of additional code to copy one more sheet into each workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-11-2013
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    25

    Re: Split pairs of worksheets to separate workbooks

    Here you go (Thanks!):

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 06-17-2016 at 05:02 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Split pairs of worksheets to separate workbooks

    Maybe this:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-11-2013
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    25

    Re: Split pairs of worksheets to separate workbooks

    Thank you so much for your prompt reply.

    When I run the code - I get a Run-time error '438' / Object doesn't support this property or method.

    When I hit debug - this is the highlighted line of code: ThisWorkbook.Sheets("RawData").Copy Before:=(ActiveWorkbook.Sheets(1))

    Thanks again!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Split pairs of worksheets to separate workbooks

    Maybe:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-11-2013
    Location
    Toronto
    MS-Off Ver
    2013
    Posts
    25

    Re: Split pairs of worksheets to separate workbooks

    Thanks - That did it!

  8. #8
    Registered User
    Join Date
    11-22-2013
    Location
    seattle
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Split pairs of worksheets to separate workbooks

    Thank you so much for this post - this was exactly what I was looking for. However, when other users try to run the macro on our company network, they are getting an error code (Error 1004 “Application-defined or Object-defined error”). Any idea how to resolve?

  9. #9
    Registered User
    Join Date
    11-22-2013
    Location
    seattle
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Split pairs of worksheets to separate workbooks

    I figured out the problem. I was using the shared drive letters in my macro (i.e. R:\) but the other user who was getting the error had the shared drive mapped to a different letter. By using the server name instead (i.e. \\servername\) of the drive letter, the macro runs fine. Thank you again for the original code!

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split worksheets to separate files
    By ksteffin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2013, 06:04 AM
  2. Split multi-tab workbook into separate workbooks
    By ahurst105 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2013, 06:51 PM
  3. How to split excel file into separate workbooks based on number of columns?
    By nandana83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2012, 04:03 AM
  4. [SOLVED] Split table, based on two criteria, into separate workbooks
    By gingert88 in forum Excel General
    Replies: 6
    Last Post: 07-10-2012, 06:08 PM
  5. Split Excel report and save separate Workbooks to respective locations
    By seattle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2010, 03:30 AM
  6. Split into Separate Worksheets
    By bigroo1958 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2010, 10:54 AM
  7. Split my data into separate worksheets
    By drunk8gods in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-12-2010, 04:20 PM
  8. [SOLVED] Macro to Split Workbook into separate Workbooks
    By jmurray in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-14-2009, 04:44 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