Sub test() With Range("C1", Range("B65536").End(xlUp)).Offset(, 250) .Formula = "=IF(C2="""","""",IF(C1<>C2,1,""""))" .Value = .Value On Error Resume Next With Intersect(.SpecialCells(xlCellTypeConstants) _ .EntireRow, Range("A:D")).Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlThick End With On Error GoTo 0 .ClearContents End With End Sub