jasonfish11
Board Regular
- Joined
- May 14, 2015
- Messages
- 56
Hi all,
I can't find a solution to the problem I'm having anywhere.
I built a simple userform that will appear when a workbook is opened.
There is a warning notice and 2 command buttons "Continue" and "Leave/Exit"
Below is the coding for both.
The issue I'm having is I would like the "Continue" button to be the default so that if someone just reads it and hits enter the userform closes but the workbook stays open. I can see in the properties that the "Continue" button is default=True and the "Leave/Exit" button is default=false. The issue is when I hit enter in this userform the "leave/exit" macro runs. Also the "Leave/Exit" button is the one framed with the dots (indicating it's the default). I tried switching the default to "Leave/Exit" in properties and nothing changed.
I've attached an image of the properties.
Thanks in advance.
I can't find a solution to the problem I'm having anywhere.
I built a simple userform that will appear when a workbook is opened.
There is a warning notice and 2 command buttons "Continue" and "Leave/Exit"
Below is the coding for both.
The issue I'm having is I would like the "Continue" button to be the default so that if someone just reads it and hits enter the userform closes but the workbook stays open. I can see in the properties that the "Continue" button is default=True and the "Leave/Exit" button is default=false. The issue is when I hit enter in this userform the "leave/exit" macro runs. Also the "Leave/Exit" button is the one framed with the dots (indicating it's the default). I tried switching the default to "Leave/Exit" in properties and nothing changed.
I've attached an image of the properties.
VBA Code:
Private Sub ContinueCommand_Click()
Unload ChromeWarning
End Sub
Private Sub LeaveCommand_Click()
Unload ChromeWarning
ActiveWorkbook.Close SaveChanges:=False
End Sub
Thanks in advance.