Bedingte Formatierung auf vbRed stellen mit With Anweisungen
11.02.2026 20:19:36
mckater
bin gerade am Lieblingsprojekt wieder dabei und hätte da eine Frage.
Bedingte Formatierung, was ich ja so überhaupt nicht mag wirklich....
Rng1.Select
For i = 1 To 1
Application.CutCopyMode = False
Application.CutCopyMode = False
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlNotBetween, _
Formula1:="=$E$220+$F$220", Formula2:="=$E$220+$G$220"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16776961
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Next i
Wie kann ich der For, With sagen....hey ich will da nicht .Color = -16776961
Sondern ich will da anstelle der Nummer, vbRED haben (was ja diese Color ist)
Im Internet werde ich da nicht schlau, weil der meckert dann ständig im Modul
Ich will einfach für jede Routine hier anstelle der langen Zahl für ROT, vbRed drinnen haben
Ich habe mehrere For und With im Code.
Vielleicht ist es ja einfach oder auch nicht....mit der Nummer funktioniert es super....aber vbRed mag der nicht in VBA Excel
mfg mckater
Anzeige