ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Saving Sheets into Multiple Files (https://www.excelbanter.com/excel-discussion-misc-queries/69351-saving-sheets-into-multiple-files.html)

becaboo77

Saving Sheets into Multiple Files
 
I have a file with about 25 tabs (sheets) in it, but I want to save each tab
as a separate file & name the file the tab name. Is there a way to do this
automatically, or will I have to manually move each sheet into a new file &
save it?

Ron de Bruin

Saving Sheets into Multiple Files
 
Hi becaboo77

Try this macro
http://www.rondebruin.nl/copy6.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"becaboo77" wrote in message ...
I have a file with about 25 tabs (sheets) in it, but I want to save each tab
as a separate file & name the file the tab name. Is there a way to do this
automatically, or will I have to manually move each sheet into a new file &
save it?




Anne Troy

Saving Sheets into Multiple Files
 
Try this, boo: http://vbaexpress.com/kb/getarticle.php?kb_id=448
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

"becaboo77" wrote in message
...
I have a file with about 25 tabs (sheets) in it, but I want to save each
tab
as a separate file & name the file the tab name. Is there a way to do
this
automatically, or will I have to manually move each sheet into a new file
&
save it?




Dave Peterson

Saving Sheets into Multiple Files
 
Option Explicit
Sub testme()
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
wks.Copy 'to a new workbook
With ActiveSheet
.Parent.SaveAs Filename:="C:\temp\" & .Name
.Parent.Close savechanges:=False
End With
Next wks
End Sub

Adjust the path to what you want.

becaboo77 wrote:

I have a file with about 25 tabs (sheets) in it, but I want to save each tab
as a separate file & name the file the tab name. Is there a way to do this
automatically, or will I have to manually move each sheet into a new file &
save it?


--

Dave Peterson

Jim May

Saving Sheets into Multiple Files
 
Sub SheetsToSepBooks()
Set shOrig = Sheets(1).name
For Each sh In ActriveWorkbook.Worksheets
sh.Copy
ActiveWorkbok.SaveAs FileName:= "C:\Samples\" & sh.name & ".xls"
ActiveWorkbook.Close
Next sh
shOrig.Activate
End Sub

HTH


"becaboo77" wrote:

I have a file with about 25 tabs (sheets) in it, but I want to save each tab
as a separate file & name the file the tab name. Is there a way to do this
automatically, or will I have to manually move each sheet into a new file &
save it?



All times are GMT +1. The time now is 10:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com