how to create a macro button to exit a program

  • Thread starter Thread starter PACEBIT0708
  • Start date Start date
P

PACEBIT0708

I am trying to set up a menu page at the beginning of my workbooks. The
buttons I have are: 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.
 
This tutorial is pretty helpful:
http://www.anthony-vba.kefra.com/vba/vbabasic1.htm#Creating_Your_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--
 

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

Back
Top