ich hätte gerne das eine Zelle in Spalte I farbig hinterlegt wird, wenn in dieser nicht
"Herrn" bzw. "Frau" steht
Ich hab hier meinen code aber irgendwie funktioniert er nicht.
Könnt ihr mir bitte helfen?
Sub Anrede()
Dim var_ANREDE
Range("I2:I10").Select
Dim i
Application.ScreenUpdating = False
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i, 1) = "Herrn" Then
If Cells(i, 1) = "Frau" Then
Else: Selection.FormatConditions(Selection.FormatConditions.Count). _
SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End If
End If
Next i
Application.ScreenUpdating = False
End Sub