Hello,
I have this formula in MicroSoft Excel 2002 and was wondering if anyone could help by telling me how I would be able to sort my worksheet by colors (color 20, 35, and 19 - see below)? So I would like a formula (VBA) that I could run or add on to the below vba, which would bring all rows that are colored to the top of the page. Any help would be great!
Thank you!
Sub color()
'
Dim rngCell As Range, rngArea As Range
Set rngArea = ActiveSheet.Range("A1:A1:K30000")
For Each rngCell In rngArea
If Left(rngCell.Value, 6) = "315329" Then _
Range(rngCell, rngCell.Offset(0, -3)).Interior.ColorIndex = 20
If Left(rngCell.Value, 6) = "315637" Then _
Range(rngCell, rngCell.Offset(0, -3)).Interior.ColorIndex = 35
If Left(rngCell.Value, 6) = "315251" Then _
Range(rngCell, rngCell.Offset(0, -3)).Interior.ColorIndex = 19
Next
Set rngArea = Nothing
End Sub
Configuration: Windows XP Internet Explorer 6.0