+ Reply to Thread
Results 1 to 6 of 6

Split worksheets in same workbook into new workbook

  1. #1
    Registered User
    Join Date
    11-18-2016
    Location
    Islamabad, Pakistan
    MS-Off Ver
    2010
    Posts
    42

    Split worksheets in same workbook into new workbook

    Hi,

    I have around 50 worksheets and I want to create a separate workbook for every sheet I am trying to use the following code but its not working;

    Sub Splitbook()
    'Updateby20140612
    Dim xPath As String
    xPath = Application.ActiveWorkbook.Path
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
    Next
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub

    can any 1 help me on this.
    I am using excel 2010

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Split worksheets in same workbook into new workbook

    In what way doesn't it work?
    Also please edit your post to include code tags.

  3. #3
    Registered User
    Join Date
    11-18-2016
    Location
    Islamabad, Pakistan
    MS-Off Ver
    2010
    Posts
    42

    Re: Split worksheets in same workbook into new workbook

    The individual file saved doesn't have a format I have to open and save the each workbook as an excel file

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Split worksheets in same workbook into new workbook

    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-18-2016
    Location
    Islamabad, Pakistan
    MS-Off Ver
    2010
    Posts
    42

    Re: Split worksheets in same workbook into new workbook

    Thanks for the help

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Split worksheets in same workbook into new workbook

    You're welcome

+ 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. Split workbook into worksheets
    By Chaverim in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-09-2017, 01:52 PM
  2. Excel 2003 Macro - Split data in two worksheets and place in a individual workbook
    By Isabelle Whyte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2014, 04:30 AM
  3. Split workbook into multiple workbooks with worksheets
    By itgeltugs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-21-2014, 11:51 PM
  4. Split data by Criteria into separate worksheets on one workbook
    By TrebleC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2013, 08:39 AM
  5. [SOLVED] Need help linking 2 macros: create workbook and split into many worksheets
    By esmithqg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-13-2012, 06:27 PM
  6. [SOLVED] Split data into different worksheets in a new workbook.
    By fdotlix in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-31-2012, 07:01 PM
  7. Replies: 0
    Last Post: 09-19-2005, 03:05 PM

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