Msg boxes

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
 
D

Dick Kusleika

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
 
J

Jake Marx

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]
 
Top