VbYesNo Msg Box

  • Thread starter Thread starter mjack003
  • Start date Start date
M

mjack003

Howdy,

I've connected a macro to a command button but before executing I nee
a Yes/No msgbox to appear. How would I go about creating a msgbox tha
if "yes" execute, if "no" End sub? Any help is appreciated.

Best Regard,
Mjac
 
option explicit
sub testme01()
dim Resp as long
resp = msgbox(Prompt:="Continue?",buttons:=vbyesno)
if resp = vbno then
'msgbox "Quitter!"
exit sub
end if

'rest of code here
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