cav~firez22
Well-known Member
- Joined
- Jun 21, 2006
- Messages
- 543
Hi all,
i have this code,
What would i do to make it so once it has saved a file, it closes that file and continues on.
Currently, it just keeps them open, and the workbook it is going through has over 100 sheets, there fore i end up with 100 excel windows open.??
any ideas?
i have this code,
Code:
Sub Test1()
Application.ScreenUpdating = False
Dim ws As Worksheet, strPath$, strSheetName$
strPath = ThisWorkbook.Path & "\"
For Each ws In Worksheets
strSheetName = ws.Name
Workbooks.Add 1
ws.Cells.Copy Cells
Sheets(1).Name = strSheetName
ActiveWorkbook.SaveAs strPath & strSheetName & ".xls"
Next
Application.ScreenUpdating = True
End Sub
What would i do to make it so once it has saved a file, it closes that file and continues on.
Currently, it just keeps them open, and the workbook it is going through has over 100 sheets, there fore i end up with 100 excel windows open.??
any ideas?