hide userform when another userform is shown on top

lpking2005

Board Regular
Joined
Mar 21, 2011
Messages
140
Currently i click a button which opens userform1, then a button on userform1 opens another userform containing pictures (userform2), when they click the picture it closes userform2 and goes back to userform1.

What I need is when the user opens userform2, I want userform1 to hide in the background so the user cannot see it and then when they close userform, have userform1 reappear.

It is very important that userform1 remains still running in the background.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
In Userform1, open the other UF with this code

Code:
Me.Hide
Show UserForm2
Show UserForm1

In UserForm2
Code:
Private Sub Image1_Click()
    Unload Me
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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