try this soluction:
'in the class moduleuserform2
'showmodale=false
Private Sub CommandButton1_Click()
Dim d
d = Now
UserForm1.Show vbModeless
'your code
'for example
Do
Loop Until Now (d + TimeValue(00:00:10))
Unload UserForm1
End Sub
'in the class moduleuserform1
Private Sub
I've got a pretty long-running macro inside a UserForm, and I wanted
to open a second form just to show that things are still working and
not crashed. It's pretty simple - four labels and I cycle around
turning one at a time a different color.
I call it from the main form with
Private Sub