VBA If Statements

  • Thread starter Thread starter Runner77
  • Start date Start date
R

Runner77

Hello,

The following Code which give me a message to either click Yes or N
How do i Get it to Close UserForm4 when I click on No

Regards
Runner77

Private Sub cmbexit_Click()
MsgAdd = MsgBox("Would you like to place another order?", vbYesNo
"Thank You for Your Order?")
If MsgAdd = vbYes Then UserForm4.Hide
UserForm1.Show
DoEvents
End Su
 
It appears to me that you want to close UserForm 4 in either event.
Therefore:

Private Sub cmbexit_Click()
MsgAdd = MsgBox("Would you like to place another order?", vbYesNo,
"Thank You for Your Order?")
UserForm4.Hide
If MsgAdd = vbYes Then UserForm1.Show
DoEvents
End Sub

Does this work for you?
 

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