Msg boxes

  • Thread starter Thread starter Alisha
  • Start date Start date
A

Alisha

sori im not very good with computers,

can u pls tell me exactly wat needs to by typed.i kno
where 2 type it.
i want a message box saying yes or no
 
u shud tip

Dim lResp As Long

lResp = MsgBox("Answer yes or no", vbYesNo)

If lResp = vbYes
'Do something
Else
'Do something else
End If

i hop tht hlps
 
Hi Alisha,

Sub test()
Dim l As Long

l = MsgBox(Prompt:="Please click yes or no", _
Buttons:=vbQuestion Or vbYesNo Or vbDefaultButton1, _
Title:="Question")

If l = vbYes Then
MsgBox "You clicked yes"
Else
MsgBox "You clicked no"
End If
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

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