MsgBox

  • Thread starter Thread starter Ed Davis
  • Start date Start date
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?
 
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.
 
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
 
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
 
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
 
Back
Top