ActiveSheet.Cells.FormatConditions.Delete
If
VonA <>
""
Or
BisA <>
""
Then
With
ActiveSheet.Range(
"E6:XFD6"
)
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND(E6>=DATWERT("
""
& VonA &
""
");E6<=DATWERT("
""
& BisA &
""
"))"
.FormatConditions(.FormatConditions.Count).SetFirstPriority
With
.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
End
With
End
With
End
If
If
VonB <>
""
Or
BisB <>
""
Then
With
ActiveSheet.Range(
"E8:XFD8"
)
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND(E6>=DATWERT("
""
& VonB &
""
");E6<=DATWERT("
""
& BisB &
""
"))"
.FormatConditions(.FormatConditions.Count).SetFirstPriority
With
.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
End
With
End
With
End
If
If
VonC <>
""
Or
BisC <>
""
Then
With
ActiveSheet.Range(
"E9:XFD9"
)
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=UND(E6>=DATWERT("
""
& VonC &
""
");E6<=DATWERT("
""
& BisC &
""
"))"
.FormatConditions(.FormatConditions.Count).SetFirstPriority
With
.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
End
With
End
With
End
If