Save sheet?

H

Heine

How can i save 200 sheets in an excel file as 200 excel file with name of
sheet as file name. Due to the number of sheets it is needed to be done
automaticly.
 
B

Bob Phillips

Sub SaveSheets()
Dim i As Long

With ThisWorkbook
For i = 1 To .Worksheets.Count
.Worksheets(i).Copy
ActiveWorkbook.SaveAs Filename:=Worksheets(i).Name & ".xls"
Next i
End With

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Easily fixed

Sub SaveSheets()
Dim i As Long

With ThisWorkbook
For i = 1 To .Worksheets.Count
.Worksheets(i).Copy
ActiveWorkbook.SaveAs Filename:=Worksheets(i).Name & ".xls"
Activeworkbook.Close
Next i
End With

End Sub



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
H

Heine

Well - it looks like you both know - anyway, thanks for great support in
short time notice. I had a bad feeling i had to manually cut, past, name and
save them. Would have taken loooong time.
 

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