Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
save and exit macro icystorm Excel Programming 8 June 25th 12 11:50 PM
Save/exit macro andrewbt Excel Programming 2 August 4th 07 08:54 PM
Excel Save as & Exit macro [email protected] Excel Programming 0 July 26th 07 07:50 AM
Write macro don't ask to save when exit excel Rui Alvares Excel Programming 0 March 29th 06 12:50 AM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM


All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"