Excel Message Box : Yes - No


Posted by Shamsuddeen. P.k on November 22, 2001 2:57 PM

I have defined a message box with Yes and No buttons.

I would like to know how to assign the user selection (whether Yes or No) to a variable and execute If-else-Endif based on the assigned value.

Regards,

Shamsuddeen. P.K

Posted by s-o-s on November 22, 2001 3:32 PM

Hi Shamsuddeen,

Please review the attached:

Reply = MsgBox("Are you over 18?" & Chr(10) &" Please answer Yes or No.", vbYesNo)

If Reply = vbYes Then

do some code

Else

do some other code

End If

Hope this helps
s-o-s

=================



Posted by Shamsuddeen. P.K on November 22, 2001 3:58 PM

Thank you very much for the prompt reply.

Regards,

Shamsudden