How can i unload userform1 and show userform2 correctly?

MisterExcellent

New Member
Joined
Apr 21, 2011
Messages
46
Hello all!

How can i show then unload userform1 and show userform2 correctly?

The first userform should be shown, if the listbox is filled.
If the listbox is filled and the userform1 is shown, i can unload this userform and show userform2 with a commandbutton.
If there are no data (the listbox is empty) it should unload and show the second userform.

My solution doesn't work:
Code:
If ListBox1.ListCount = 0 Then UserForm1.Hide [COLOR=DarkOrange]And Userform2.Show[/COLOR]
    Application.OnTime Now + TimeValue("00:00:02"), "ThisWorkbook.Close"
Else
    Me.Show
End If
End Sub
I look forward to your approach..
Bye for now..

Version: Excel2003
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Help me please :(

I might have expressed myself unclear, the problem is if I want to open Userform1, which is closing itself. Then I want to open Userform3 but if the Listbox on the Userform3 is not filled, it should be shown for 2 seconds, close itself and Userform2 should open itself.

How can I do this? Help me, please :confused:
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,470
Members
452,915
Latest member
hannnahheileen

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
Back
Top