Mit nachfolgendem Code weise ich dem Spaltenbereich "Vb_Währung" eine bedingte Formatierung zu.
Dies funktioniert solange, als ich den Bereich zuerst mit GoTo anwähle. Das ist ja wie selektieren.
Wenn ich die Zeile mit GoTo weglasse, stimmt die bedingte Formatierung nicht immer - das ist wohl abhängig, welche Zelle gerade ausgewählt ist. Gibt es eine Möglichkeit, nicht mit GOTO resp. SELECTION zu arbeiten?
Gruss, Peter
Application.GoTo Reference:="Vb_Währung"
With Range("Vb_Währung")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="=BEREICH.VERSCHIEBEN(F5;;-1)F5"
.FormatConditions(1).Interior.ColorIndex = 38
.FormatConditions.Add Type:=xlExpression, Formula1:="=REST(ZEILE();2)=1"
.FormatConditions(2).Interior.ColorIndex = 34
End With