pop up box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How can I create a pop up box that asks a question and then takes answers in
yes/no?
 
ans = MsgBox ("Continue (yes) or quit (no)?",vbYesNo)
If ans = vbYes Then
'etc.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Look at the MsgBox function in VBA help...

If MsgBox("Did you do it? ", vbQuestion + vbYesNo, "Swati") = vbYes Then
'something
Else
'something else
End If
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"swati" <[email protected]>
wrote in message
Hi,
How can I create a pop up box that asks a question and then takes answers in
yes/no?
 
Probably the quickest is the MsgBox.

Sub popUp()
PopUp = MsgBox("WILL THIS DO THE TRICK?", vbYesNo + vbQuestion, "MY POP-UP")
If PopUp = vbYes Then
MsgBox "That's It"
Else
MsgBox "Not What I wanted"
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top