View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Abhijeet Gudur Abhijeet Gudur is offline
external usenet poster
 
Posts: 20
Default Macro to SAVE and EXIT from EXCEL

Option Explicit
Sub Save_close()
'Whichever file contains this code will remain open in the end
Dim wb As Workbook

For Each wb In Workbooks
If wb.Name = ThisWorkbook.Name Then
'do nothing
Else
wb.Close savechanges:=True
End If
Next wb

End Sub



On Monday, 25 November 2013 05:38:15 UTC+5:30, pcorcele wrote:
The heading says it all.

I want to save any open Excel files and then Close Excel

Thanks