View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default 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.