RedOctoberKnight
Board Regular
- Joined
- Nov 16, 2015
- Messages
- 153
- Office Version
- 2016
- Platform
- Windows
Good Morning,
I'm currently working on a project for work and slowly trying to teach myself VBA in the process. I have a Userform set up and I want to be able to show another textbox based on certain values in a combo box.
I have the following code that I've been experimenting with. I can get it to work for the one condition but I want it to be able to work for all the conditions. I want the text box to appear when Text1, 2 and 3 are selected but hide when text4, 5, and 6 are selected.
Any help would be much appreciated.
Thanks,
I'm currently working on a project for work and slowly trying to teach myself VBA in the process. I have a Userform set up and I want to be able to show another textbox based on certain values in a combo box.
I have the following code that I've been experimenting with. I can get it to work for the one condition but I want it to be able to work for all the conditions. I want the text box to appear when Text1, 2 and 3 are selected but hide when text4, 5, and 6 are selected.
VBA Code:
Private Sub ComboBox1_change()
If ComboBox1 = "TEXT1" Then
TextBox1.Visible = True
Else
TextBox1.Visible = False
End If
End Sub
Any help would be much appreciated.
Thanks,