Yodelayheewho
Member
When executing the following code and selecting "Yes" it works as intended it saves the userform and displays the confirmation message. However, when selecting "No" it unloads the form without displaying the message.
Thank you in advance for your consideration!
Code:
'Exit Form Button'
Private Sub FormExit_Click()
Dim MsgBoxResult As Long
MsgBoxResult = MsgBox("Save Changes?", vbYesNo)
If MsgBoxResult = vbYes Then
ActiveWorkbook.Save
MsgBox ("Your work is saved. Have a great day!")
ElseIf MsgBoxResults = vbNo Then
MsgBox ("Your work was NOT saved. See ya!")
End If
Unload MasterForm
End Sub