Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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