Results 1 to 8 of 8

how to use macro (split sheets/tab) to all open workbooks

Threaded View

  1. #1
    Registered User
    Join Date
    04-20-2015
    Location
    Kingdom of Saudi Arabia
    MS-Off Ver
    EXCEL 2013
    Posts
    6

    how to use macro (split sheets/tab) to all open workbooks

    hi everyone,

    i have this macro copied from the internet. i would copy and paste this in the VBe to split the sheets in the same workbook.
    can this macro be saved in a template, so I can open simultaneously this template and the the workbook which i need to split the sheets?
    my other macros are working while using the shortcuts. thanks.

    VBA: Split a workbook into multiple workbooks and save in the same folder.


    Sub Splitbook()
    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
    Last edited by JBeaucaire; 04-20-2015 at 01:57 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro Code to keep Formulas in Split Workbooks
    By Phil_Lloyd_1979 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2014, 10:27 AM
  2. Split this up over different workbooks or sheets.
    By a1b2c3d4e5f6g7 in forum Excel General
    Replies: 1
    Last Post: 07-31-2014, 01:42 PM
  3. [SOLVED] Copy sheets to all open workbooks ??
    By james 35 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-31-2013, 06:26 AM
  4. [SOLVED] Split Macro modification to Split into new Workbooks instead of sheets within one workbook
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-13-2012, 08:11 PM
  5. [SOLVED] How to split and consolidate sheets into new workbooks
    By Xluser@work in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2006, 05:17 AM

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