Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro - msgbox
I have a rather large macro, and I want to give the user a chance to exit the
macro before it runs. I need a msgbox (or a dialogue?) with a warning, and the user will select either OK (to run the defined macro) or cancel (to exit and not run the macro). Can anyone help me? Thanks:) |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Macro - msgbox
traima, here is an example of one with an option if yes no and cancel
Sub Message_box_test() Dim Msg, Title, Response As String Msg = "Put message here" Title = "Put title here" Response = MsgBox(Msg, vbYesNoCancel + vbQuestion, Title) If Response = vbNo Then 'your code if no is clicked here MsgBox "you clicked no" Exit Sub ' Quit the macro End If If Response = vbCancel Then 'your code if Cancel is clicked here MsgBox "You clicked cancelled" Exit Sub ' Quit the macro End If 'your code if Yes is clicked here MsgBox "you clicked yes" End Sub "traima" wrote in message ... I have a rather large macro, and I want to give the user a chance to exit the macro before it runs. I need a msgbox (or a dialogue?) with a warning, and the user will select either OK (to run the defined macro) or cancel (to exit and not run the macro). Can anyone help me? Thanks:) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I email amacro? | Excel Worksheet Functions | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
Hiding, or automatically answering, a confirmation msgbox | Excel Discussion (Misc queries) | |||
link to combobox | Excel Discussion (Misc queries) | |||
Editing a simple macro | Excel Worksheet Functions |