close "ALL"

  • Thread starter Thread starter stef
  • Start date Start date
S

stef

Excel 2002 SP3
Win XP Pro SP2

Hi,

Is there a way to "Close ALL Files" (but leave Excel open) with a mouse
click or keyboard shortcut?
 
Here is one I use to save all and close. Comment out
w.save
application.quit
the ThisWorkbook.save is for the workbook where the macro resides.

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Application.Workbooks
If w.Name <> ThisWorkbook.Name Then
w.Save
w.Close
End If
Next w
ThisWorkbook.Save
Application.Quit
End Sub
 
Ron,
Can believe how simple that was!
You'd think MS could put the "Close All" as a "regular" menu item....
Thanks!
 
Back
Top