Sub SortColors()
'test this on a copy of your data first because
'you can't undo it
'code only sorts highlighted or not highlighted
'insert a column in your table and title it SORT
'select the cell in the second row of the SORT column
Dim Anchor
Anchor = ActiveCell.Address
If MsgBox("Sort by color", vbYesNo) = vbNo Then
Exit Sub
End If
Do While Selection.Row <> ActiveCell.SpecialCells(xlLastCell).Row
If Selection.Interior.ColorIndex <> xlNone Then
Selection = "X"
Selection.Offset(1, 0).Select
Else
Selection.Offset(1, 0).Select
End If
Loop
Range(Anchor).Select
Selection.Sort _
Key1:=Range(Anchor), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub