folgendes Problem, in meinem Userform habe ich 3 Textboxen A,B und C, diese sind deaktiviert und Grau hinterlegt. Zudem habe ich zwei Checkboxen A&B und B&C (siehe Bild)
Mein Ziel ist es wenn ich eine Checkbox anklicke sollen die jeweiligen Textboxen aktiviert und Weiss hinterlegt werden.
Beim abwählen einer checkbox soll nur die jeweilige unbenutze Textbox deaktiviert werden, da die andere noch aktiviert bleiben soll, wird noch gebraucht.
img src="https://www.herber.de/bbs/user/46393.jpg" border=0>
Hier ist mal mein nicht funktionierender Code:
Private Sub CheckBox1_Click()
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox1.BackColor = &H80000009
TextBox2.BackColor = &H80000009
If CheckBox1 = False & CheckBox2 = True Then
TextBox1.Enabled = False
TextBox1.BackColor = &H8000000F
Else
TextBox1.Enabled = False
TextBox1.BackColor = &H8000000F
TextBox2.Enabled = False
TextBox2.BackColor = &H8000000F
End If
End Sub
Private Sub CheckBox2_Click()
TextBox2.Enabled = True
TextBox2.BackColor = &H80000009
TextBox3.Enabled = True
TextBox3.BackColor = &H80000009
If CheckBox2 = False & CheckBox1 = True Then
TextBox3.Enabled = False
TextBox3.BackColor = &H8000000F
Else
TextBox2.Enabled = False
TextBox2.BackColor = &H8000000F
TextBox3.Enabled = False
TextBox3.BackColor = &H8000000F
End If
End Sub
Vielen dank für eure Hilfe
Patrick