I have read about my question on this forum but cannot find the thread.
I want to unload a userform before closing the file and quitting Excel. I was told by smart people on this forum not to just "quit" without unloading the form because doing so leaves stuff (?) in memory.
However, when the form is unloaded, the rest of the code below the unload statement is not run because the code is in the userform. Here is my code.
How does one get around this issue?
thanks for looking
I want to unload a userform before closing the file and quitting Excel. I was told by smart people on this forum not to just "quit" without unloading the form because doing so leaves stuff (?) in memory.
However, when the form is unloaded, the rest of the code below the unload statement is not run because the code is in the userform. Here is my code.
Code:
Private Sub CommandButton5_Click()
ThisWorkbook.Save
Unload UserForm1
ThisWorkbook.Close
MsgBox ("Your data has been saved."), vbInformation
Application.Quit
End Sub
How does one get around this issue?
thanks for looking