Preventive Message

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

Guest

Hello

Could anyone tell me how can I create a message box which give users change to confirm Yes/No before proceed to a certain task/run a macro

Thanks
 
Try something like the following at the top of your macro.


If MsgBox("Continue?", vbYesNo) = vbNo Then
Exit Sub
End If



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


POH said:
Hello,

Could anyone tell me how can I create a message box which give
users change to confirm Yes/No before proceed to a certain
task/run a macro.
 
Hi
try something like

Sub foo()
Dim msbans
msbans = MsgBox("Do you want to continue?", vbYesNo)
If msbans = vbYes Then
'run your code
else
exit sub
End If
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

POH said:
Hello,

Could anyone tell me how can I create a message box which give users
change to confirm Yes/No before proceed to a certain task/run a macro.
 

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

Similar Threads

macros 3
AOL email scam 2
Access MS Access VB 0
Message Box 6
Custom Dialog Box Macro for Excel 3
Hoping to disable Protection Warning message 4
Data Validation - Prevent delete 2
message box 2

Back
Top