ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel close + save by button press. how? (https://www.excelbanter.com/excel-programming/363953-excel-close-save-button-press-how.html)

tomro1[_6_]

excel close + save by button press. how?
 

i need a code that if you press a button that the excel file save
itself and then closes.

th

--
tomro
-----------------------------------------------------------------------
tomro1's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread.php?threadid=55083


Chip Pearson

excel close + save by button press. how?
 
Try the following procedure.


Sub SaveAllAndQuit()
Dim WB As Workbook
For Each WB In Workbooks
WB.Save
Next WB
Application.Quit
End Sub

Create a new command button and assign this macro to it.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"tomro1"
wrote in message
...

i need a code that if you press a button that the excel file
saves
itself and then closes.

thx


--
tomro1
------------------------------------------------------------------------
tomro1's Profile:
http://www.excelforum.com/member.php...o&userid=35081
View this thread:
http://www.excelforum.com/showthread...hreadid=550836




tomro1[_8_]

excel close + save by button press. how?
 

works like a charm

thanks :

--
tomro
-----------------------------------------------------------------------
tomro1's Profile: http://www.excelforum.com/member.php...fo&userid=3508
View this thread: http://www.excelforum.com/showthread.php?threadid=55083



All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com