Message box & close worksheet
Jock,
Private Sub CommandButton1_Click()
Dim Response as long
Response = MsgBox("Do you wish to order another item?", vbYesNo)
If response = vbYes Then
TextBox3.SetFocus
Else
ThisWorkbook.Close True
End If
End Sub
Also, check the Help for "Option Explicit".
NickHK
"Jock" wrote in message
...
Code bolow doesn't close the worksheet when 'no' is chosen rather than
yes.
Any ideas?
Private Sub CommandButton1_Click()
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
|