Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For interest purposes, this is the code that I sent.
Sub DoPatternSort() Dim rRange As Range Dim lRowStart As Long, lRowEnd As Long, lRow As Long On Error GoTo ErrorEnd Application.ScreenUpdating = False Set rRange = Selection.CurrentRegion lRowStart = rRange.Row + 1 lRowEnd = rRange.Rows.Count rRange.Cells(1, 2).EntireColumn.Insert For lRow = lRowStart To lRowEnd Step 1 rRange.Cells(lRow, 2) = rRange.Cells(lRow, 1).Interior.ColorIndex Next lRow rRange.Sort Key1:=rRange.Cells(2, 2), Order1:=xlDescending, _ Key2:=rRange.Cells(2, 3), Order2:=xlAscending, _ Key3:=rRange.Cells(2, 1), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal, _ DataOption3:=xlSortNormal rRange.Cells(1, 2).EntireColumn.Delete ErrorEnd: Application.ScreenUpdating = True End Sub -- Hope this helps Martin Fishlock, Bangkok, Thailand Please do not forget to rate this reply. "JILANI" wrote in message ... HI PLS SHOW HOW TO SORT COLORS IN EXCEL IN DETAIL WAY |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do u sort a cell (results or multiple cities) inexcel by name | Excel Discussion (Misc queries) | |||
sort cells by color ?Macro? | Excel Programming | |||
How do I sort or count cells by fill color? | Excel Discussion (Misc queries) | |||
Can I sort excel spreadsheet data by fill color of cells? | Excel Discussion (Misc queries) | |||
Can you sort excel data by color coded cells? | Excel Discussion (Misc queries) |