Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
SBárbara
 
Posts: n/a
Default Save sheets in a folder

How can i Save in separate files the sheets of my worksheet, without being
one by one...

Regards,
S Bárbara
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron de Bruin
 
Posts: n/a
Default Save sheets in a folder

Hi SBárbara

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


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



"SBárbara" wrote in message ...
How can i Save in separate files the sheets of my worksheet, without being
one by one...

Regards,
S Bárbara



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Save sheets in a folder


SBárbara wrote:
How can i Save in separate files the sheets of my worksheet, without being
one by one...

Regards,
S Bárbara


Here's one way to do it.
1. Open the workbook you want to copy from.
2. Press Alt-F11 to show the editor.
3. Click Insert on the menu, then Module.
4. Copy and insert the code shown below.
5. Press Alt-F11 to return to the spreadsheet view.
6. Save the file
7. See notes below! When ready, run the sub (Tools|Macros|select
SaveSheets from the list)

Sub SaveSheets()
Dim j As Integer
Application.DisplayAlerts = False
With ThisWorkbook
For j = 1 To .Worksheets.Count
.Worksheets(j).Activate
ActiveSheet.Copy
ActiveWorkbook.SaveAs "C:\myFolder\" & ThisWorkbook.Name _
& "_" & ActiveSheet.Name & ".xls"
ActiveWorkbook.Close
Next j
End With
Application.DisplayAlerts = True
End Sub

Notes:
1. This presumes you have created a folder called myFolder on your C:
drive to hold the new workbooks. If you want to use a different path,
change the name of the path in the code.
2. This code saves the resulting workbooks with the name of the main
workbook plus an underscore plus the name of the sheet.
3. The next time you run the routine, it will not ask you if you want
to replace the existing workbooks. If you want it to ask you whether
to replace the existing workbooks, remove the lines that include the
words DisplayAlerts.

James

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default Save To directory doesn't work Excel 2003 [email protected] Excel Discussion (Misc queries) 1 March 20th 06 11:44 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM
I wish to save my Excell work in my work sheets CLC 37 Qld Excel Worksheet Functions 0 May 24th 05 10:56 AM
Save as Default folder Gerry Cornell Excel Discussion (Misc queries) 2 December 13th 04 06:41 PM
cannot save file - folder is read only BigDog Excel Discussion (Misc queries) 1 December 7th 04 11:18 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"