ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Need VB formula to exit workbook (https://www.excelbanter.com/excel-worksheet-functions/346193-need-vbulletin-formula-exit-workbook.html)

dave

Need VB formula to exit workbook
 
Hello,

I need a VB formula to exit workbook. When pressed to close button on
the form, I want the whole workbook saved and closed. Please help

Thanks

Dave

Gord Dibben[_2_]

Need VB formula to exit workbook
 
VBA does not deal in formulas. I think you need a macro.

Sub closer()
Application.DisplayAlerts = False
With ActiveWorkbook
.Save
.Close
End With
Application.DisplayAlerts = True
End Sub


Gord

On Tue, 24 Jan 2012 12:43:13 -0800 (PST), dave
wrote:

Hello,

I need a VB formula to exit workbook. When pressed to close button on
the form, I want the whole workbook saved and closed. Please help

Thanks

Dave



All times are GMT +1. The time now is 08:07 PM.

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