zombiemaster
Board Regular
- Joined
- Oct 27, 2009
- Messages
- 245
I have a simple Yes/No message box that will exit the sub if the user clicks "no". I saw on another forum where someone mentioned that we can "add another condition to test the user's response for something else in addition to vbYes (perhaps to test for no response by clicking the X to close the form)", but they didn't actually provide the code...
I haven't been able to find that code that will also exit the sub if the user clicks the "" to exit the message box instead of clicking one of the buttons. I figured if I'd find someone who knew the answer, it would be here...
Here is my existing message box VBA:
Thanks for your help as always!
~ZM~
I haven't been able to find that code that will also exit the sub if the user clicks the "" to exit the message box instead of clicking one of the buttons. I figured if I'd find someone who knew the answer, it would be here...
Here is my existing message box VBA:
Code:
Dim varResponse As Variant
varResponse = MsgBox(" --==BEFORE RUNNING THIS REPORT==--"
& vbCrLf & vbCrLf & "--==DOWNLOAD TODAY'S REPORT FROM DOC DIRECT==--"
& vbCrLf & vbCrLf & " Have you downloaded the report from Doc Direct?",
vbYesNo, "Selection")
If varResponse <> vbYes Then Exit Sub
Thanks for your help as always!
~ZM~