Hi all, looked all over the internet for the answer to my problem. I am trying to use a macro to split out 14 tabs each saved as its own file (named according to the tab name). The tabs themselves have macros that need to be preserved. I have the code below which almost does the trick (brings the macros over, saves as separate files, and deletes extra tabs) however it only deletes the tabs previous to the one being saved. So if tabs are A, B, C, then the first file is named 'A' (with A, B, C); second file is named 'B' (with B, C), and 3rd is named 'C' (with C only). Thanks in advance.


Sub SplitSheets()
    Dim ipath As String, sh, newpath As String
    Set wbsource = ActiveWorkbook
       
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    ipath = ActiveWorkbook.Path & "/"
    On Error GoTo Err_SplitSheets
    For Each sh In wbsource.Sheets
    sh.Copy
    sh.SaveAs ActiveWorkbook.Path & "/" & sh.Name     
    Next sh

Err_SplitSheets:
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
End Sub