#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default msgbox cancel?

I have a snippet of code attached to a clickable button that emails a
workbook to a specified address. However, I would like a confirmation box to
pop up asking for confirmation before this action is taken. I've gotten as
far as:

Dim response As Long
response = MsgBox(prompt:="Are you sure you would like to submit?",
Buttons:=vbOKCancel)

Now, when OK is clicked, the form executes as it should. But, if I click
cancel, the button still executes. How do I program it to do nothing and
return to the form I was just using, taking no action, if cancel is clicked?
Thanks...


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default msgbox cancel?

if msgbox("Are you sure", vbyesno) = vbyes then
msgbox "Do Something"
else
msgbox "you selected no so nothing will happen"
endif
--
HTH...

Jim Thomlinson


"sycsummit" wrote:

I have a snippet of code attached to a clickable button that emails a
workbook to a specified address. However, I would like a confirmation box to
pop up asking for confirmation before this action is taken. I've gotten as
far as:

Dim response As Long
response = MsgBox(prompt:="Are you sure you would like to submit?",
Buttons:=vbOKCancel)

Now, when OK is clicked, the form executes as it should. But, if I click
cancel, the button still executes. How do I program it to do nothing and
return to the form I was just using, taking no action, if cancel is clicked?
Thanks...


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default msgbox cancel?

thanks!

"Jim Thomlinson" wrote:

if msgbox("Are you sure", vbyesno) = vbyes then
msgbox "Do Something"
else
msgbox "you selected no so nothing will happen"
endif
--
HTH...

Jim Thomlinson


"sycsummit" wrote:

I have a snippet of code attached to a clickable button that emails a
workbook to a specified address. However, I would like a confirmation box to
pop up asking for confirmation before this action is taken. I've gotten as
far as:

Dim response As Long
response = MsgBox(prompt:="Are you sure you would like to submit?",
Buttons:=vbOKCancel)

Now, when OK is clicked, the form executes as it should. But, if I click
cancel, the button still executes. How do I program it to do nothing and
return to the form I was just using, taking no action, if cancel is clicked?
Thanks...


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Box - CANCEL Danny Excel Worksheet Functions 6 December 1st 06 02:15 AM
Save - Yes / No / Cancel Jon Peltier Excel Discussion (Misc queries) 9 May 7th 06 02:03 AM
cancel input ME @ Home Excel Discussion (Misc queries) 1 February 22nd 06 09:49 AM
can I cancel a save juls!1601 Excel Discussion (Misc queries) 2 February 16th 06 01:03 AM
Read Only - How to Cancel? Glenn Excel Discussion (Misc queries) 1 August 26th 05 06:23 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"