ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save Sheets In Different Files (https://www.excelbanter.com/excel-programming/430988-save-sheets-different-files.html)

Faraz A. Qureshi

Save Sheets In Different Files
 
Dear felows,

Need your expertise in having a weekly database file with 52 sheets be saved
into different files with names as displayed in a specific cell. For instance
every sheet has a date in its respective cell C1 as a date, like 1/1/09,
1/8/09, 1/15/09 etc. I want them to be saved in different files each with
names like 2009-1-1, 2009-1-8, 2009-1-15 etc. i.e. date in C1 as the filename
in the format yyyy-m-d, in a specific folder like D:\NewFolder\

Thanx in advance friends.

--
Best Regards,

Faraz

Jacob Skaria

Save Sheets In Different Files
 
Hi Faraz

If all the sheets cell c1 has a valid **unique** date the below should do
with out any errors..

Sub Macro()
Dim wb As Workbook
Dim strFolder As String
Set wb = ActiveWorkbook
strFolder = "D:\NewFolder\"
Application.ScreenUpdating = False
For Each shTemp In wb.Sheets
shTemp.Copy
ActiveWorkbook.SaveAs strFolder & Format(Range("c1"), "yyyy-m-d")
ActiveWorkbook.Close True
Next
Application.ScreenUpdating = True
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Faraz A. Qureshi" wrote:

Dear felows,

Need your expertise in having a weekly database file with 52 sheets be saved
into different files with names as displayed in a specific cell. For instance
every sheet has a date in its respective cell C1 as a date, like 1/1/09,
1/8/09, 1/15/09 etc. I want them to be saved in different files each with
names like 2009-1-1, 2009-1-8, 2009-1-15 etc. i.e. date in C1 as the filename
in the format yyyy-m-d, in a specific folder like D:\NewFolder\

Thanx in advance friends.

--
Best Regards,

Faraz


Ron de Bruin

Save Sheets In Different Files
 
See also
http://www.rondebruin.nl/copy6.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Faraz A. Qureshi" wrote in message
...
Dear felows,

Need your expertise in having a weekly database file with 52 sheets be saved
into different files with names as displayed in a specific cell. For instance
every sheet has a date in its respective cell C1 as a date, like 1/1/09,
1/8/09, 1/15/09 etc. I want them to be saved in different files each with
names like 2009-1-1, 2009-1-8, 2009-1-15 etc. i.e. date in C1 as the filename
in the format yyyy-m-d, in a specific folder like D:\NewFolder\

Thanx in advance friends.

--
Best Regards,

Faraz




All times are GMT +1. The time now is 08:45 PM.

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