VbYesNo Msg Box

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
 
D

Dave Peterson

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
 
Top