Going from userform1 to userform2 and then back to userform1

MFish

Board Regular
Joined
May 9, 2019
Messages
76
I have a combobox1 in UF1 that is coded as...

Code:
sub combobox1_change()
[INDENT]
userform2.show
[/INDENT]

end sub

Once userform2 shows up, I need another combobox to select something.

Code I have...
Code:
Sub combobox1()
[INDENT]
Me.combobox1.List = Worksheets("Drop Down Data").Range("d3:d51").Value
[/INDENT]

end sub

Once selected I press submit, on a commandbutton1, and after pressing submit it will transfer that data, I just selected within userform2 in combobox, to textbox1 in userform1.

But when I try to use code...

Code:
sub commandbutton1_click()

[INDENT]userform1.show
[/INDENT]

end sub

It says it won't be able to perform because that userform is already opened.. How do I get the userform to show again and taking the value of that combobox in userform2 into a textbox in userform1?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If you did not hide it, then it is already "displayed". you probably should do a userform2.hide to get back to userform1.
 
Last edited:
Upvote 0
Try this:

Userform1:

Code:
Private Sub ComboBox1_Change()
    UserForm1.Hide
    UserForm2.Show
End Sub

Userform2:

Code:
Private Sub CommandButton1_Click()
    UserForm1.TextBox1.Value = Me.ComboBox1.Value
    UserForm1.Show
    Unload Me
End Sub

-----------
Or Change the ShowModal property of both userforms to False In the properties of the userform.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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