Is something like this what you are after ? I didn't consider sorting since you can do that with the Macro Recoder and then intergrate it.
Option Explicit
Sub ColorRowsByID()
Dim firstRow As Long
Dim IColor As Long
Dim first As Variant
Dim second As Variant
Application.ScreenUpdating = False
firstRow = 2
IColor = 6
Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
Do While Cells(firstRow, "F") <> ""
first = Cells(firstRow, "F").Value
second = Cells(firstRow, "F").Offset(1, 0).Value
If second = first Then
Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
Else
Range(Cells(firstRow, 1), Cells(firstRow, 54)).Interior.ColorIndex = IColor
If IColor = 6 Then IColor = xlNone Else IColor = 6
End If
firstRow = firstRow + 1
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks