Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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