Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi James,
I don't know about closing all files, but to close save and close all Excel workbooks, put this macro in a common module or ThisWorkbook module. This will save the workbook with the code last and then close the entire excel application. Sub CloseWorkbooks() Dim wkbk As Workbook 'loop through workbook collection For Each wkbk In Application.Workbooks If wkbk.Name < ThisWorkbook.Name Then wkbk.Close True Else End If Next wkbk 'save this workbook ThisWorkbook.Save 'close the excel application Application.Quit End Sub Regards, Tim James A wrote: Is there any way to record a macro to save and close alll open files? -- James A |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help (Uppercase multiple ranges?) | Excel Discussion (Misc queries) | |||
Run multiple excel files off of one macro. | Excel Discussion (Misc queries) | |||
Cannot save excel files to a folder on a network | Excel Discussion (Misc queries) | |||
Save a Macro | Excel Discussion (Misc queries) | |||
can't save newly opened files | Excel Discussion (Misc queries) |