close "ALL"

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?
 
R

Ron de Bruin

Hi Stef

Hold the Shift key when you click on the File menu en you see Close all
 
D

Don Guillett

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
 
S

stef

Ron,
Can believe how simple that was!
You'd think MS could put the "Close All" as a "regular" menu item....
Thanks!
 

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