ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Messagr (https://www.excelbanter.com/excel-programming/392365-messagr.html)

Jock

Messagr
 
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

Chip Pearson

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




All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com