Excel97: Show UserForm while running code?
Hi
Demo: Put in a standard module:
Sub StartCode()
UserForm1.Show
End Sub
Sub MainCode(Optional B As Boolean)
Dim L As Long
For L = 1 To 5000
UserForm1.Caption = L & " of 5000"
UserForm1.Repaint
Cells(L, 1).Select
Cells(L, 1).Value = L
Next
Unload UserForm1
End Sub
And in the userform module:
Private Sub UserForm_Activate()
Me.Repaint
DoEvents
Call MainCode
End Sub
Animated Gif ? Not possible, sorry.
HTH. Best wishes Harald
"Kozo Morimoto" skrev i melding
...
We still use Excel 97 at my place of work (don't ask).
I'd like to display a "Please wait while processing..." message (a
UserForm
with an animated GIF) while the VBA is running and processing. Is this
possible to do? Whenever I do Form.show, the VBA code stops until I close
the UserForm. I really don't want to move all the code into the Form if
possible.
|