i need a code that if you press a button that the excel file saves itself and then closes.
thx
i need a code that if you press a button that the excel file saves itself and then closes.
thx
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" <tomro1.299dzn_1150064702.719@excelforum-nospam.com>
wrote in message
news:tomro1.299dzn_1150064702.719@excelforum-nospam.com...
>
> 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
>
works like a charm
thanks :d
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks