Moving from a userform to another userform

patupatu

New Member
Joined
Apr 7, 2011
Messages
23
Hello.

I have a userform from which I pick up some values, then I seach in a excel sheet for that value, and then I have another userform in which I want to display the data found. How do I close a form and open another. And can I send parameters to somehow conditioned how the other form would sppear?

Thank you very much

Patupatu
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How do I close a form and open another.

Kind of depends on where you are doing this from. For example, if you want to close UserForm1 from within the code of UserForm1, you can simply use

Code:
Unload Me

If you want to close UserForm1 from a worksheet's code, you could use:

Code:
Unload UserForm1

To open another form:

Code:
UserForm2.Show


can I send parameters to somehow conditioned how the other form would sppear

You could write your own Sub that accepts parameters and have it called by Private Sub UserForm_Initialize() so that it executes when the form opens.
 
Upvote 0
If the data is related, another option might be to use a Multi-Page control and just switch pages.
 
Upvote 0

Forum statistics

Threads
1,224,562
Messages
6,179,526
Members
452,923
Latest member
JackiG

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