ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to create a macro button to exit a program (https://www.excelbanter.com/excel-worksheet-functions/184848-how-create-macro-button-exit-program.html)

PACEBIT0708

how to create a macro button to exit a program
 
I am trying to set up a menu page at the beginning of my workbooks. The
buttons I have a Enter School Data, Manipulate Data, Print Reports,
Completion on time, Print Charts, New Referrals, Blank Button, Exit program.
How do I get the exit button to work. To be honest I could not get the
macros to work with the other buttons, so I used hyperlink, but am stuck on
this one. Any suggestions please, I am desparate.

ryguy7272

how to create a macro button to exit a program
 
This tutorial is pretty helpful:
http://www.anthony-vba.kefra.com/vba...ur_First_Macro


Code should be something like this:
Sub ExitNow()
Application.DisplayAlerts = True
Application.Quit
End Sub


After you have your code in a module follow these steps:
Right-click in the toolbar area, click 'Forms', click on the Button, drag
the mouse and set the size of the button, in the box that open click the
macro name (ExitNow), and the click OK.

Regards,
Ryan--

--
RyGuy


"PACEBIT0708" wrote:

I am trying to set up a menu page at the beginning of my workbooks. The
buttons I have a Enter School Data, Manipulate Data, Print Reports,
Completion on time, Print Charts, New Referrals, Blank Button, Exit program.
How do I get the exit button to work. To be honest I could not get the
macros to work with the other buttons, so I used hyperlink, but am stuck on
this one. Any suggestions please, I am desparate.



All times are GMT +1. The time now is 09:47 PM.

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