VBA
25.08.2018 09:30:36
Holger
viellicht kann mir jemand bei meinem Problem helfen.
Ich versuche durch anklicken auf Kontrollkästchen folgende Kennzeichen farblich hervorzuheben.
Das alles klappt auch, möchte den Code gerne verkürzen, da noch einige Kennzeichen dazu kommen.
Meine Frage wäre jetzt, gibt es eine Möglichkeit, die Kennzeichen in eine Zeile bzw. in eine Rheie zu schreiben evtl. Formula1:="VEC-BB", Formula2:="MI-FF" , Formula3:="B-AF"
anstelle
Selection.FormatConditions.Add Type:=xlTextString, String:="VEC-BB", _
Kann mich für eure Hilfe nur bedanken.
VG
Holger
Aktuell:
Sub makro1()
Selection.FormatConditions.Add Type:=xlTextString, String:="VEC-BB", _
TextOperator:=xlContains
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Selection.FormatConditions.Add Type:=xlTextString, String:="MI-FF", _
TextOperator:=xlContains
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16383844
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13551615
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub