File Saving

  • Thread starter Thread starter Gazza
  • Start date Start date
G

Gazza

If i have a workbook with say 4 worksheets named Alpha Beta, Gamma & Delta

How can i set up a file saving routine that would produce from the original
file 4 files called

Alpha.xls
Beta.xls
Gamma.xls
Delta.xls

Each of the new workbooks would only have 1 worksheet - that which
corresponds to the worksheet of the same name from the origina workbook.

Cheers

Gazza
 
Dim sPath as String
Dim sh as Worksheet
sPath = Activeworkbook.Path
for each sh in ActiveWorkbook.Worksheets
sh.copy
activeworkbook.SaveAs sPath & "\" & sh.Name & _
".xls", xlNormal
activeworkbook.Close SaveChanges:=False
Next
 
Ron,

Impressed with your version too - especially the saving into a seperate
directory

Thanks very much

Gazza
 

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

Back
Top