Sub CreateWorkbooks()
Dim wb As Workbook
Dim wbs As Workbook
Dim sht As Object
Dim strSavePath As String
On Error GoTo ErrorHandler
Application.ScreenUpdating = False
strSavePath = "C:\Documents and Settings\vatan\Desktop\"
Set wbs = ActiveWorkbook
For Each sht In wbs.Sheets
sht.Copy
Set wb = ActiveWorkbook
wb.SaveAs strSavePath & sht.Name
wb.Close
Next
Application.ScreenUpdating = True
Exit Sub
ErrorHandler:
MsgBox "Failed. Error number=" & Err.Number & ". Error description=" & Err.Description & "."
End Sub
strSavePath = "C:\Documents and Settings\vatan\Desktop\"




کامنت