MsgBox

E

Ed Davis

I have been search the web for hours looking for example spreadsheets using
MsgBox to no avail.
Can someone direct me in the right direction?
 
E

Ed Davis

What I am looking to do is ask a question and if the answer is "yes" do 1
thing and if "no" do something else.
 
P

Per Jessen

Hi

Look at this:

Sub test()
Answer = MsgBox("Do you want to continue ?", vbYesNo + vbQuestion, "Best
regards, Per Jessen")

If Answer = vbYes Then
'user clicked yes
Else
'user clicked no
End If
End Sub

Regards,
Per
 
G

Gord Dibben

Too bad you did not search VBA help for 30 seconds.

Would have saved many hours.

The example shown in help is very similar to what Per posted for you.


Gord Dibben MS Excel MVP
 
E

Ed Davis

Thank You Very much That worked great.

Per Jessen said:
Hi

Look at this:

Sub test()
Answer = MsgBox("Do you want to continue ?", vbYesNo + vbQuestion, "Best
regards, Per Jessen")

If Answer = vbYes Then
'user clicked yes
Else
'user clicked no
End If
End Sub

Regards,
Per
 

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

Top