I have a userform whereby users specify an input using button controls. When the user clicks OK, the form should unload and then a subroutine is executed that loads a second userform telling the user to "Please Wait" while it executes. The problem I'm having is that the first userform does not unload and stays in the background behind the second userform. Is there any special way to unload or suppress a userform? Here's my code:
UserForm1 code looks like (the variable Model is user input):
Public Sub OKButton_Click()
Dim Model As Integer
Model = 0
If Model1 Then Model = 1
If Model2 Then Model = 2
Unload UserForm1
SubMacro (Model)
End Sub
SubMacro code looks like:
Public SubMacro (Mode)
Application.ScreenUpdating = False
With PleaseWaitForm
.Show (Modeless)
.Repaint
End With
' there is other code here
End Sub
Any help would be greatly appreciated. Thanks!
UserForm1 code looks like (the variable Model is user input):
Public Sub OKButton_Click()
Dim Model As Integer
Model = 0
If Model1 Then Model = 1
If Model2 Then Model = 2
Unload UserForm1
SubMacro (Model)
End Sub
SubMacro code looks like:
Public SubMacro (Mode)
Application.ScreenUpdating = False
With PleaseWaitForm
.Show (Modeless)
.Repaint
End With
' there is other code here
End Sub
Any help would be greatly appreciated. Thanks!