Private Sub TextBox1_Change()
If Val(TextBox1.Text) = 10 Then
TextBox1.BackColor = vbGreen
Else
TextBox1.BackColor = vbRed
End If
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = IIf(TextBox1.Value = "OK", vbGreen, vbRed)
End Sub