Are you sure popup box

  • Thread starter Todd Huttenstine
  • Start date
T

Todd Huttenstine

How do you get a simple little popup box or message to pop
up when you click a command button before the code runs?
I want the popup box to say something like "Are you sure"
and then give the user an option to click Yes or No, or
Cancel. If the user click no or cancel the code does not
run, if the user clicks Yes, the popup box goes away and
then the code run.

How do I do this?


Thanx

Todd Huttenstine
 
C

Chip Pearson

Todd,

Use the MsgBox function. For example

If MsgBox("Are you sure?", vbYesNo) = vbNo Then
Exit Sub
End If

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
T

Todd Huttenstine

Thanx, comes in very handy.
-----Original Message-----
Todd,

Use the MsgBox function. For example

If MsgBox("Are you sure?", vbYesNo) = vbNo Then
Exit Sub
End If

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)






.
 

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

Top