Seperating worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a workbook with about 15 worksheets in it. Is there a quick way to
automatically seperate all 15 into single workbooks. or do I have to go 1 by
1?

Thanks,
Steve
 
Hi Steve

Try this macro
It will save each sheet in a seperte wornook in C:\

Sub test()
Dim a As Integer
Dim wb As Workbook
Application.ScreenUpdating = False
For a = 1 To ThisWorkbook.Worksheets.Count
ThisWorkbook.Sheets(a).Copy
Set wb = ActiveWorkbook
wb.SaveAs "C:\" & wb.Sheets(1).Name & ".xls"
wb.Close False
Set wb = Nothing
Next a
Application.ScreenUpdating = True
End Sub
 
The problem i am running into is that i can't find it. I am on a network here
at work. I swapped the c:/ with the path where i want the file to be saved.
We do not have a c drive. Shouldn't have worked? I can't find the seperated
documents anywhere.
 
I have test in on my home network with

wb.SaveAs "\\Jelle\SharedDocs\" & wb.Sheets(1).Name & ".xls"

and it is working for me
 

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