Need VB formula to exit workbook

D

dave

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
 
G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top