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
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
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
Another one
http://www.rondebruin.nl/copy6.htm
--
Regards Ron de Bruin
http://www.rondebruin.nl
"Zorro" <[email protected]> wrote in message news:[email protected]...
> 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
>
Thanks guys.
Zorro
"Ron de Bruin" <[email protected]> wrote in message
news:[email protected]...
> Another one
> http://www.rondebruin.nl/copy6.htm
>
>
> --
> Regards Ron de Bruin
> http://www.rondebruin.nl
>
>
> "Zorro" <[email protected]> wrote in message
> news:[email protected]...
>> 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
>>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks