Question on UserForms with variable options

jameslytle

New Member
Joined
Jul 30, 2018
Messages
21
Is there a way to set up a userform where it will show one option (i.e. a dropdown list) when one factor is selected but show another option (i.e a pure text box) when another factor is selected?

Or do I need to create two separate userforms and then depending on which factor is selected that particular userform will be initiated?

Jim
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Something like
Code:
Private Sub ComboBox1_Click()
   If Me.ComboBox1.Value = "Fluff" Then
      Me.TextBox1.Visible = True
   Else
      Me.ComboBox2.Visible = True
   End If
End Sub

Private Sub UserForm_Initialize()
   Me.TextBox1.Visible = False
   Me.ComboBox2.Visible = False
End Sub
 
Upvote 0
Fluff,

Can this be done and both of the boxes occupy the same space on the userform or do they need to be offset? I am thinking they will have to be offset otherwise as it would make it hard to click on them during the development stage.
 
Upvote 0
It might make things a bit fiddly having them on top of each other in development but there's nothing to stop you doing it.

If you didn't want to do that what you could do is, as well as making them visible, reposition them.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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