UF_Textbox_Enter
20.05.2013 09:07:21
chrissi
ich habe eine Userform mit 50 TextBoxen,
wenn ich eine TextBox auswähle soll sich die Farbe ändern.
Mein Code:
Private Sub TextBox1_Enter()
With TextBox1
If .BackColor = &HE0E0E0 Then
.BackColor = &HFF00&
ElseIf .BackColor = &HFF00& Then
.BackColor = &HE0E0E0
End If
txt1.SetFocus
End With
End Sub
Private Sub TextBox2_Enter()
With TextBox2
If .BackColor = &HE0E0E0 Then
.BackColor = &HFF00&
ElseIf .BackColor = &HFF00& Then
.BackColor = &HE0E0E0
End If
txt1.SetFocus
End With
End Sub
Private Sub TextBox3_Enter()
With TextBox3
If .BackColor = &HE0E0E0 Then
.BackColor = &HFF00&
ElseIf .BackColor = &HFF00& Then
.BackColor = &HE0E0E0
End If
txt1.SetFocus
End With
End Sub
usw. bis 50
Nun ist es so, dass sich beim erstenmal wenn ich z.B. Textbox1 auswähle alle anderen
TextBoxen ebenfalls grün färben.
klicke ich alle einzeln an wird die normale Farbe erstellt.
wo Liegt der Fehler?
Danke!
Gruß
Chrissi