TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 270
- Office Version
- 365
- Platform
- Windows
Hello,
I have some code that is triggered when the user clicks the red x to close the workbook. The code opens a form and the user has two options "yes" and "no".
If they click no I just want the form to disappear and they were as they were before it popped up. I tried
but the workbook still closes.
How do I force it to just close the userform down? It's remembering the fact that the red x was clicked.
Many thanks.
I have some code that is triggered when the user clicks the red x to close the workbook. The code opens a form and the user has two options "yes" and "no".
If they click no I just want the form to disappear and they were as they were before it popped up. I tried
VBA Code:
Private Sub CommandButton2_Click()
Cancel = True
Me.Hide
End Sub
but the workbook still closes.
How do I force it to just close the userform down? It's remembering the fact that the red x was clicked.
Many thanks.