Ich bräuchte wieder mal Eure Hilfe.
das Makro unten habe bei meinen Recheren im Internet gefunden.
Es überprüft in einer UserForm 30 TextBoxen auf doppelte Eingaben. Das funktionier soweit auch ganz gut. Das Problem ist nur, es werden auch leere TextBoxen geprüft.
Da nicht immer alle TextBoxen befüllt werden, dürfen wirklich nur TextBoxen mit Inhalt geprüft wird, TextBoxen ohne Inhalt sollen ignoriert werden.
Danke im Voraus für die Mühe!
Gruß Dieter
For i = 1 To 30
For j = 1 To 30
If i j Then
If Controls("TextBox" & i) = Controls("TextBox" & j) Then
Controls("TextBox" & i).BackColor = vbYellow
Controls("TextBox" & j).BackColor = vbYellow
blnDoppel = True
Else
Controls("TextBox" & i).BackColor = vbWhite
End If
End If
Next
Next
MsgBox "Doppelte Einträge", 16, "Hinweis"
If blnDoppel Then Exit Sub