Ich bin seit Std. wieder einmal am ausprobieren und bin zu "blöd" was hinzubekommen!
Mittels folgendem Codeschnipsel wird beim Öffnen der UF die TextBox4 befüllt:
Dim zelle As Range
Dim sBegriff As Date
If IsDate(TextBox1) Then
sBegriff = CDate(TextBox1)
Else
MsgBox "Sie müssen das Feld Datum befüllen", _
vbInformation, "Hinweis"
End If
If sBegriff = 0 Then Exit Sub
Set zelle = Worksheets(4).Columns(1) _
.Find(sBegriff, LookAt:=xlWhole)
If zelle Is Nothing Then
End If
TextBox4.Text = zelle.Offset(0, 1)
Das Ergebnis ist ein T, ein N oder nichts.
Nun soll das Feld - wenn T - hellblau sein, - wenn N - hellgrün ansonsten weiß.
So wie folgt geht es nicht:
If TextBox4 = "" Then TextBox4.BackColor = &H80000005
If TextBox4 = "T" Then TextBox4.BackColor = &HFF00&
If TextBox4 = "N" Then TextBox4.BackColor = &HFFFF00
Weiß jemand Rat? Wenn ja, bitte helfen und vorab eion dickes Dankeschön!
Gruß, herzlichst Frank H.