Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to show vbYesNo Message box, and then triggering actions based on whether user selects Yes or No

Hi.

I have this so far:

sub MsgBoxTest()

     dim Message1

     set Message1 = MsgBox("Do you want to save current selections?", vbYesNoCancel)

end sub

How do I write the VB Script to continue on to do this:

If user selects yes, - Trigger some action (e.g. save current selections to a bookmark, BM01)

If user selects no or cancel - Don't do anything

Thanks for your help!

2 Replies
Not applicable
Author

sub MsgBoxTest()

     dim Message1

     set Message1 = MsgBox("Do you want to save current selections?", vbYesNoCancel)

     If Message1 = vbYes then

     Action1

     Else

     Action2

     End if

end sub

m_woolf
Master II
Master II