ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   pop up box (https://www.excelbanter.com/excel-programming/393811-pop-up-box.html)

swati

pop up box
 
Hi,
How can I create a pop up box that asks a question and then takes answers in
yes/no?

Bob Phillips

pop up box
 
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)

"swati" wrote in message
...
Hi,
How can I create a pop up box that asks a question and then takes answers
in
yes/no?




Jim Cone

pop up box
 

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"
wrote in message
Hi,
How can I create a pop up box that asks a question and then takes answers in
yes/no?

JLGWhiz

pop up box
 
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

"swati" wrote:

Hi,
How can I create a pop up box that asks a question and then takes answers in
yes/no?



All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com