Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Msgbox Yes/No Button values 1

Status
Not open for further replies.

protector

Technical User
Mar 16, 2002
18
0
0
NZ
Hello everyone

Can anyone tell me how I get the button click values from a message box. I need the values to complete an if else statement in the code.

Thanks in advance for the help

Craig

 
Hi,

Here's all there is to it...
Code:
    ans = MsgBox("Yes or no?", vbYesNoCancel)
    Select Case ans
        Case vbYes
            'yes stuff goes here
        Case vbNo
            'no stuff goes here
        Case vbCancel
            'cancel stuff goes here
    End Select
Hope this helps :) Skip,
SkipAndMary1017@mindspring.com
 
Hi Skip

Thanks for the quick reply, code works great, thanks for the help

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top