Sub CopyWorkbook()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim ws As Worksheet
Dim y As String, x As String, xpath As String, u As String
Set ws = ActiveSheet
x = ActiveWorkbook.Name
For Each ws In ActiveWorkbook.Worksheets
u = ws.Name & ".xls"
ws.Copy
xpath = "Your Path Here."
ActiveWorkbook.SaveAs Filename:=xpath & "\" & u, FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Workbooks(x).Activate
Next ws
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
|