Habe eben mal schnell hier auf einem anderen System getestet (arbeite doch sonst noch mit Excel 03). Folgender Code sollte laufen. Die Bedingung zumindest eine wie <5 gibt das auch bei Formular1 an (frühr stand da nur die Zahl). Der Code "löscht" deshalb das erste Zeichen davon raus.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 19 Then
If Target.FormatConditions.Count > 0 Then
If IsNumeric(Target.Value) Then
If CLng(Target.Value) < CLng(Right(Target.FormatConditions(1).Formula1, Len(Target.FormatConditions(1).Formula1) - 1)) Then MsgBox "Achtung, Ein Substrat hat den Mindestbestand erreicht!"
End If
End If
End If
End Sub
Falls das auch nicht klappt, lass mal bitte das durchlaufen. Damit zeigt er dir die Formatierung in einer Msgbox an. Die dann mal posten und wir ändern den Code entsprechend.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Target.Column = 19 Then
If Target.FormatConditions.Count > 0 Then
If IsNumeric(Target.Value) Then
MsgBox Target.FormatConditions(1).Formula1
If CLng(Target.Value) < CLng(Right(Target.FormatConditions(1).Formula1, Len(Target.FormatConditions(1).Formula1) - 1)) Then MsgBox "Achtung, Ein Substrat hat den Mindestbestand erreicht!"
End If
End If
End If
End Sub
|