Thread: Messagr
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Messagr

You need to store the result of MsgBox and test the result.

Dim Res As VbMsgBoxResult
Res = MsgBox("Whatever", vbYesNo)
If Res = vbYes Then
' user clicked 'Yes'
Else
' user clicked 'No'
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Jock" wrote in message
...
Private Sub CommandButton1_Click()
"Do some stuff and then-"

MsgBox("Do you wish to order another item?", _
vbYesNo)

If response = vbYes Then
If vbYes Then
TextBox3.SetFocus
Else
ThisWorkbook.Close True
End If
End If

End Sub
--
tia

Jock