Hallo Excel Profis,
ich habe ein Problem mit einer bedingten Formatierung in einer TextBox6
Zuvor lade ich Werte in TextBox6, so:
UserForm1.TextBox6.Value = Format(UserForm1.TextBox6.Value, "0.00 %")
Nun möchte ich, dass wenn der Wert 0 ist, die TextBox6 eine rote HG Farbe bekommt.
mein augenblicklicher Code:
Private Sub TextBox6_Change()
Dim val As Double
val = Val(UserForm1.TextBox6.Value)
If val 0 Then
' Rot
TextBox6.BackColor = &HFF&
Else
TextBox6.BackColor = &H80000001
End If
End Sub
erzeugt die Fehlermeldung: Erwarte Datenfeld
Kann mir bitte jemand dabei helfen, entsprechende bedingte Formatierung umzusetzen?
Gruss
Fred