Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Macro to save sheets as separate workbooks
can anyone help with a macro to save each worksheet as a separate book
(named as its sheet name) to a given folder (C:\mydocs\myfolder)? Many thanks Zorro |
#2
|
|||
|
|||
Option Explicit
Sub testme() Dim wks As Worksheet Dim newWks As Worksheet For Each wks In activeworkbook.worksheets wks.Copy 'to a new workbook Set newWks = ActiveSheet With newWks Application.DisplayAlerts = False .Parent.SaveAs Filename:="C:\mydocs\myfolder\" & .Name, _ FileFormat:=xlworkbooknormal Application.DisplayAlerts = True .Parent.Close savechanges:=False End With Next wks End Sub It also overwrites any existing file (if one exists). If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Zorro wrote: can anyone help with a macro to save each worksheet as a separate book (named as its sheet name) to a given folder (C:\mydocs\myfolder)? Many thanks Zorro -- Dave Peterson |
#3
|
|||
|
|||
Another one
http://www.rondebruin.nl/copy6.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Zorro" wrote in message . .. can anyone help with a macro to save each worksheet as a separate book (named as its sheet name) to a given folder (C:\mydocs\myfolder)? Many thanks Zorro |
#4
|
|||
|
|||
Thanks guys.
Zorro "Ron de Bruin" wrote in message ... Another one http://www.rondebruin.nl/copy6.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Zorro" wrote in message . .. can anyone help with a macro to save each worksheet as a separate book (named as its sheet name) to a given folder (C:\mydocs\myfolder)? Many thanks Zorro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Divide worsheet and save as separate files | Excel Worksheet Functions | |||
Combine Workbooks as separate worksheets | Excel Discussion (Misc queries) | |||
saving excel with multiple sheets, but won't save to proper sheet | Excel Discussion (Misc queries) | |||
WorkBooks In Separate Windows. | New Users to Excel | |||
How do I save sheets in a workbook to separate files? | Excel Worksheet Functions |