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.)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

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 !!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,805
Messages
5,833,764
Members
430,230
Latest member
Yimmie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top