nachstehenden Code hatte mir freundlicherweise Nepumuk ins Klassenmodul reingebastelt.
Wie kann ich es machen, dass dieser Code nur für die Textboxen 1 To 19 gilt und nicht für Textbox20.
Textbox20 hab ich mir als Suchfeld eingerichtet.
Mein Versuch einer Schleife war nicht so toll.
Vielen Dank für Eure Hilfe.
VG Jörg
Option Explicit
Private WithEvents mobjTextBox As MSForms.Textbox
Private Sub Class_Terminate()
Set Textbox = Nothing
End Sub
Friend Property Get Textbox() As MSForms.TextboxSet Textbox = mobjTextBox
End Property
Friend Property Set Textbox(ByRef probjTextBox As MSForms.Textbox)
Set mobjTextBox = probjTextBox
End Property
Private Sub mobjTextBox_Change()
With Textbox
If .TextLength 0 Then
.BackColor = &H80000005
Else
.BackColor = &HFF&
End If
End With
End Sub