Use MsgBox to Execute Optional User Choice


February 13, 2002 - by Juan Pablo Gonzalez

David asks:

How can i link something like a message box which works like a hyperlink. I would like something which the user gets asked a question and yes leads to macro and no does nothing.

Use a MsgBox!

If MsgBox("My Question", vbYesNo,"Title") = vbYes then
	'Do something
Else
	'Don't do anything
End If