+ Reply to Thread
Results 1 to 4 of 4

Split multi-tab workbook into separate workbooks

Hybrid View

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    4

    Split multi-tab workbook into separate workbooks

    Hello,

    I have a macro that I LOVE that takes multiple workbooks (single tab) and combines them into one workbook w/ multiple tabs. I'm looking for the reverse of that. I very frequently get workbooks with multiple tabs that I want to separate, but the move/copy function gets a little monotonous after awhile. I'd ideally like a folder where I can add said multi-tab'd workbook and then open my macro'd excel file and poof! Multiple workbooks would cascade across my screen like a flowing river. Anyone know how that might work?

    I'm using Excel 2010.

    Thanks,
    Aaron

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Split multi-tab workbook into separate workbooks

    Aaron

    You could adapt this so you can select the workbook(s) to split out.

    As it is it splits out the workbook the code is in, ie ThisWorkbook.

    Sub SplitWBtoWS()
    Dim wbNew As Workbook
    Dim WS As Worksheet
    Dim strFilename As String
    
        For Each WS In ThisWorkbook.Worksheets
    
            strFilename = WS.Name
    
            WS.Copy
    
            Set wbNew = ActiveWorkbook
    
            wbNew.SaveAs ThisWorkbook.Path & Application.PathSeparator & strFilename
    
            wbNew.Close SaveChanges:=False
    
        Next WS
    
    End Sub
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Split multi-tab workbook into separate workbooks

    Norie, this wasn't QUITE what I was looking for as far as ease of use, but quite honestly, after testing it out I think it's actually a better result than what I envisioned. It split all of my tabs into the separate worksheets and stored them in the folder the worksheet originated in - it's perfect and exactly what I need it !

    Thank you so much for the help!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Split multi-tab workbook into separate workbooks

    Aaron

    What exactly where you looking for?

    That code I posted was just an example which could be adapted.

    For example, code could be added to allow the user to select the workbook they want to split out.

+ 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