AW: Bedingte Formatierung zwei Kriterien
17.08.2015 16:36:48
Tom
Hallo noch einmal,
eine Frage habe ich noch. Wenn in der Zelle $K7 ein k oder i gesetzt wird, soll in der Zelle $AC7 ein ja eingetragen werden oder je nach Zeichen in $K7 auch ein nein. Wie lässt sich das am besteln lösen. Folgenden Code habe ich bisher stehen.
'Datengültigkeit mit Drop-Down-Auswahl in Spalte K einfügen
With .Range(.Cells(Zeile_Z1, 11), .Cells(Zeile_Z, 11)).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="k,b,i,u,a"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Auswahl für Art"
.InputMessage = ""
.ErrorMessage = "Zulässig sind nur Wert "" b = bl. Punkt; k = n. Kundenwunsch; i = Info, _
u = Update, a = Ablehnung"""
.ShowInput = False
.ShowError = True
End With
'Datengültigkeit mit Drop-Down-Auswahl in Spalte AC einfügen
With .Range(.Cells(Zeile_Z1, 29), .Cells(Zeile_Z, 29)).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="ja, nein"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = "Auswahl für Umsetzung"
.InputMessage = ""
.ErrorMessage = "Zulässig sind nur Wert "" ja oder nein"""
.ShowInput = False
.ShowError = True
End With
'bedingte Formatierung, wenn in Spalte K ein "b" eingetragen ist
With .Range(.Cells(Zeile_Z1, 12), .Cells(Zeile_Z, 28))
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=$K7=""b"""
With .FormatConditions(1).Interior
.Pattern = 14 'xlPatternLightUp
.PatternThemeColor = xlThemeColorLight1
' .ColorIndex = xlAutomatic
.ColorIndex = 8
.PatternTintAndShade = 0
End With
'bedingte Formatierung, wenn in Spalte K ein "i" eingetragen ist
.FormatConditions.Add Type:=xlExpression, Formula1:="=$K7=""i"""
With .FormatConditions(2).Interior
.Pattern = 14
.PatternThemeColor = xlThemeColorAccent4
.ColorIndex = 4
.PatternTintAndShade = 0
End With
'bedingte Formatierung, wenn in Spalte K ein "u" eingetragen ist
.FormatConditions.Add Type:=xlExpression, Formula1:="=$K7=""u"""
With .FormatConditions(3).Interior
.Pattern = 14
.PatternThemeColor = xlThemeColorAccent4
.ColorIndex = 15
.PatternTintAndShade = 0
End With
'bedingte Formatierung, wenn in Spalte K ein "a" eingetragen ist
.FormatConditions.Add Type:=xlExpression, Formula1:="=$K7=""a"""
With .FormatConditions(4).Interior
.Pattern = 14
.PatternThemeColor = xlThemeColorAccent4
.ColorIndex = 3
.PatternTintAndShade = 0
End With
End With
Gruß Tom