Convert Tabs to Workbook

KiloHotel

New Member
Joined
Feb 4, 2018
Messages
42
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hi Guys,

Is there a quick way to transfer tabs in a single workbook to their own workbook, Basically i have one excel file with 200+ Tabs, Each tab now needs to a file to itself so 200+ workbooks.

At the moment i am just copying and pasting and saving, Just looking for the quicker workflow.

Thanks.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Right click the tab, select "Move or Copy", Check the box "Create a copy", in the "To book" drop down pick "(new book)"
Then you can "File", "SaveAs"

or you could run the following code that takes all sheets (tabs) and creates a new workbook with the tab name as the name of the workbook... saved in the same folder as the main workbook.

Code:
Sub TabToBook()

Dim ws As Worksheet
Dim strFolder As String

strFolder = ActiveWorkbook.Path & "\"

For Each ws In ActiveWorkbook.Worksheets
    ws.Copy
    
    ActiveWorkbook.SaveAs Filename:=strFolder & ws.Name & ".xlsx", FileFormat:= _
        xlOpenXMLWorkbook, CreateBackup:=False
    
    ActiveWindow.Close
Next

MsgBox "Done", vbExclamation, "Thanks Pat"

End Sub
 
Upvote 0
Right click the tab, select "Move or Copy", Check the box "Create a copy", in the "To book" drop down pick "(new book)"
Then you can "File", "SaveAs"

or you could run the following code that takes all sheets (tabs) and creates a new workbook with the tab name as the name of the workbook... saved in the same folder as the main workbook.

Code:
Sub TabToBook()

Dim ws As Worksheet
Dim strFolder As String

strFolder = ActiveWorkbook.Path & "\"

For Each ws In ActiveWorkbook.Worksheets
    ws.Copy
   
    ActiveWorkbook.SaveAs Filename:=strFolder & ws.Name & ".xlsx", FileFormat:= _
        xlOpenXMLWorkbook, CreateBackup:=False
   
    ActiveWindow.Close
Next

MsgBox "Done", vbExclamation, "Thanks Pat"

End Sub
Is there a way to save all these documents in a folder within the folder the original document is in?
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top