I have a UserForm named "TotYrReturnsForm" with a CommandButton named "CloseButton"
The form is run in a Sub named "Enter_5Yr_Averages"
Within the Sub "Enter_5Yr_Averages", I have the following line code:
TotYrReturnsForm.Show vbModeless
This line code opens the "TotYrReturnsForm" UserForm with the CommandButton named "CloseButton"
The "CloseButton" has the following code:
Public Sub CloseButton_Click()
Unload TotYrReturnsForm
End Sub
But when I click on the "CloseButton" on the opened "TotYrReturnsForm" UserForm, nothing happens (i.e. I cannot step into the "CloseButton_Click" Macro until the entire "Enter_5Yr_Averages" Sub is run).
Oddly (at least for me), when I open the "TotYrReturnsForm" with "TotYrReturnsForm.Show" versus "TotYrReturnsForm.Show vbModeless", the "CloseButton" works fine.
How can I get the "CloseButton" to work right after the "TotYrReturnsForm" UserForm is opened with "TotYrReturnsForm.Show vbModeless" versus waiting for the entire Sub to complete?
The form is run in a Sub named "Enter_5Yr_Averages"
Within the Sub "Enter_5Yr_Averages", I have the following line code:
TotYrReturnsForm.Show vbModeless
This line code opens the "TotYrReturnsForm" UserForm with the CommandButton named "CloseButton"
The "CloseButton" has the following code:
Public Sub CloseButton_Click()
Unload TotYrReturnsForm
End Sub
But when I click on the "CloseButton" on the opened "TotYrReturnsForm" UserForm, nothing happens (i.e. I cannot step into the "CloseButton_Click" Macro until the entire "Enter_5Yr_Averages" Sub is run).
Oddly (at least for me), when I open the "TotYrReturnsForm" with "TotYrReturnsForm.Show" versus "TotYrReturnsForm.Show vbModeless", the "CloseButton" works fine.
How can I get the "CloseButton" to work right after the "TotYrReturnsForm" UserForm is opened with "TotYrReturnsForm.Show vbModeless" versus waiting for the entire Sub to complete?