Save Sheets In Different Files

F

Faraz A. Qureshi

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.
 
J

Jacob Skaria

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top