Aretradeser
Board Regular
- Joined
- Jan 16, 2013
- Messages
- 176
- Office Version
- 2013
- Platform
- Windows
In a Userform I use several TextBoxes and ComboBoxes. If in the ComboBox1 any country is selected, except "ESPAÑA" or "PORTUGAL", the TextBox7 and the ComboBox6 are disabled; by means of this code:
What code would have to be added so that both TextBox7 and ComboBox6, are coloured red when an item other than those two countries is selected?
VBA Code:
Private Sub VisibilidadControles()
Me.TextBox7.Enabled = (Me.ComboBox1 = "ESPAÑA" Or Me.ComboBox1 = "PORTUGAL")
Me.ComboBox6.Enabled = (Me.ComboBox1 = "ESPAÑA" Or Me.ComboBox1 = "PORTUGAL")
End Sub
Private Sub ComboBox1_Change()
VisibilidadControles
ComboBox2.Value = ""
End Sub
What code would have to be added so that both TextBox7 and ComboBox6, are coloured red when an item other than those two countries is selected?