TextBox_Change() kürzen ?
amintire
wie kann ich folgenden Code besser kürzen?
Private Sub TextBox1_change()
CommandButton1.Enabled = TextBox1.Value "" And TextBox2.Value "" And TextBox3.Value "" _
And textbox4.Value "" And textbox5.Value ""
End Sub
Private Sub TextBox2_change()
CommandButton1.Enabled = TextBox1.Value "" And TextBox2.Value "" And TextBox3.Value "" _
And textbox4.Value "" And textbox5.Value ""
End Sub
Private Sub TextBox3_change()
CommandButton1.Enabled = TextBox1.Value "" And TextBox2.Value "" And TextBox3.Value "" _
And textbox4.Value "" And textbox5.Value ""
End Sub
Private Sub TextBox4_change()
CommandButton1.Enabled = TextBox1.Value "" And TextBox2.Value "" And TextBox3.Value "" _
And textbox4.Value "" And textbox5.Value ""
End Sub
Private Sub TextBox5_change()
CommandButton1.Enabled = TextBox1.Value "" And TextBox2.Value "" And TextBox3.Value "" _
And textbox4.Value "" And textbox5.Value ""
End Sub
Und zwar deshalb, weil CommandButton1 hat ca. 30 TextBox felder, CommandButton2 speichert auch 30 TextBox felder.
Das Problem, das speichern soll erst möglich sein wenn die TextBox Felder mit Daten sind, also leere TextBox Felder dann ist CommandButton nicht möglich zu klicken.
Wenn ich jetzt aber bis zu 200 TextBox Felder, jeden einzelnen mit diesen Change Ereignis schreiben muss, wäre das einwenig heftig. Geht es auch einfacher? Wenn ja wie?
Vielen Dank für Eure Hilfe.
Lieben Gruß
Amina