Getting back to original sub on original form after going to different form

instanceoftime

Board Regular
Joined
Mar 23, 2011
Messages
102
I am writing some code that opens forms depending on text box input.

a subroutine in form1 "shows" form2 at which time I get input from user and again go to form3 to get input. done

I need to close form2 and form3 and

How do I get back to the original subroutine on form1 where I too off from?

Thanks Guys


(oops using vba in excel 2007)
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
userform1. show
userform2.hide
userform3.hide
,,,,
 
Upvote 0
Assuming the forms are modal, that is what should happen naturally once form 3 and form 2 are closed.
 
Upvote 0
Cool thanks. I actually had to unload the 2 forms (which is fine) rather than hide. Hide kept telling me I must hide topmost form first. I had form3 hiding then form2 hiding and even switched but kept getting the error.
 
Upvote 0
You can use unload but note that this will "kill" any data of the form, so you can't do references after unload the form.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

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