how do I make a routine run after the 'cancel' butten is pressed .
Enclose the Right part after msgbox in to paranthesis and assign the
response of msgbox to a variable
e.g
Dim userResponse As String
userResponse = MsgBox ("Do you want to save changes?"
If userResponse = vbCancel Then
'code if cancel is clicked
End If
OR if you are working on all 3 possible responses then
Select Case userResponse
Case vbOK
'code if OK clicked
Case vbNO
'code if NO clicked
Case vbCancel
'code if Cancel clicked
End Select
Sharad
"Dave" wrote in message
...
Basically I have a macro which contains a vbYesNoCancel message box. I
need
the macro to run a sub-routine when the user clicks 'cancel'. At the
moment
it just escapes out of the macro and stops. I don't seem to be able to
manipulate the vbCancel as an elseif for the user response. Is there any
kind
of onCancel functionality or another way to run a sub-routine when the
user
clicks cancel? Or do I have to create my own dialog box from scratch?
|