Messagr

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 

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