If you want to sort by a cell's interior shade (in your case, color Gray, Excel color index #15), maybe this macro can help. It assumes your data to be in column A, starting in A2, and that column B is free for evaluation and sorting purposes. Modify for color index number, data column, and evaluation ranges. Be aware that this code sorts just on one color (Gray), as you said. Other shaded (and non-shaded) cells in column A will all move down in order, starting with the first non-gray cell. If I misunderstood your question, sorry, please re-post.
''''''''''''''''''''''''''''''''''
Sub SortGray()
Dim rC As Range
Dim rS As Range
Dim cell As Range
Set rC = Range([A2], [A65536].End(xlUp))
Set rS = Range([A2], [A65536].End(xlUp).Offset(, 1))
rC.Offset(, 1).Clear
For Each cell In rC
If cell.Interior.ColorIndex = 15 Then
cell.Offset(, 1) = 1
End If
Next
rS.Sort Key1:=Range("B2"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
rC.Offset(, 1).Clear
[A1].Select
End Sub
''''''''''''''''''''''''''''''''''''
Any help?
Tom Urtis