Can someone help me with 'vbyesno' message box

D

Devitt

I can seem to get it to work...
i just want it so when i click yes it executes some code

i've tried stuff like 'if vbyes = true then blah blah blah' and other
but it doesn't seem to wanna work....

[edit] o yea im usin xl 2k
 
N

Norman Jones

Hi Devitt,

Try something like:

Sub Tester01()
Dim res As Long
res = MsgBox("Continue?", vbYesNo)
If res = vbYes Then
'Do something
Else
'Do somehing else
End If
End Sub
 
D

Devitt

Cheers m8 but i already figured it out..

i jus did :
if msgbox("blahblah",vbyesno,etc,etc) = vb yes then
blah blah bla
 
Top