>条件付き書式の削除、設定等はマクロに記録できませんでした。
こちらは、Excel2019の環境ですが、マクロの記憶はできます。
↓は、マクロの記録で作成したコードです。
Range("K2:K17").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=$K1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
Selection.FormatConditions(1).StopIfTrue = False
これに、2行目に↓を挿入します。
Selection.FormatConditions.Delete
このコードで、セル範囲を可変に、Selectを使わないようにします。
With ActiveSheet
With .Range(.Cells(2, "K"), .Cells(.Rows.Count, "K").End(xlUp))
.FormatConditions.Delete
.FormatConditions.Add _
Type:=xlCellValue, _
Operator:=xlEqual, _
Formula1:="=$K1"
.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With .FormatConditions(1).Font
.ThemeColor = xlThemeColorDark1
.TintAndShade = -0.349986266670736
End With
.FormatConditions(1).StopIfTrue = False
End With
End With