Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Default Save To directory doesn't work Excel 2003 | Excel Discussion (Misc queries) | |||
In 3 active sheets in wkbk, determine& display the # of sheets that have data | Excel Discussion (Misc queries) | |||
I wish to save my Excell work in my work sheets | Excel Worksheet Functions | |||
Save as Default folder | Excel Discussion (Misc queries) | |||
cannot save file - folder is read only | Excel Discussion (Misc queries) |