Show Userform

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
Is it possible to run code while still showing a user form if you did not start the code from the form? If I am running code forma module and do userform1.show, the code stops until the form is closed.

Alternately is there an event for when the user form fully displays?
(I tried activate and initialize and they both trigger before the form fully displays, so you see nothing but white box.)
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Harvey

Well-known Member
Joined
Nov 18, 2004
Messages
953
What are you trying to accomplish? Do you want to make a splash screen or a loading screen?
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi, Oorang,
try this
Code:
Sub test()
MsgBox "code started", 48, "title"
UserForm1.Show (vbModeless)
MsgBox "code ended", 48, "title"
End Sub
last message pops up
AND
userform can be used

kind regards,
Erik

EDIT: just curious: what are you trying to do ?
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071

ADVERTISEMENT

Pretty progress bar. (Yes I know about Chip's DLL :wink: )
 

Oorang

Well-known Member
Joined
Mar 4, 2005
Messages
2,071
Got it!
You can make a user form with whatever you want on it. Then make a label with a null caption and some appropriate color the progress bar. Try it out:)

Code:
Function A()
Dim X As Byte
For X = 1 To 100 Step 1
UserForm1.Show (vbModeless)
Application.Wait (TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 1))
UserForm1.Label1.Width = X
UserForm1.Repaint
Next X
Unload UserForm1
End Function

Thanks Eric you Rock:)
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
I understand you for
____________________________________________________
|||||||||||||||||||||||||||||| %
____________________________________________________

curious what you will come up with :wink:
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
erik.van.geit said:
I understand you for
____________________________________________________
|||||||||||||||||||||||||||||| %
____________________________________________________

curious what you will come up with :wink:
our posts crossed

you're making good progress with your code !!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,530
Messages
5,572,680
Members
412,481
Latest member
nhantam
Top