ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SORT COLOR CELLS INEXCEL (https://www.excelbanter.com/excel-programming/384257-sort-color-cells-inexcel.html)

JILANI

SORT COLOR CELLS INEXCEL
 
HI

PLS SHOW HOW TO SORT COLORS IN EXCEL IN DETAIL WAY



Paul B

SORT COLOR CELLS INEXCEL
 
Jilani,

Have a look at the sites below for a way to do it

http://www.cpearson.com/excel/SortByColor.htm

http://www.xldynamic.com/source/xld....r.html#sorting


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"JILANI" wrote in message
...
HI

PLS SHOW HOW TO SORT COLORS IN EXCEL IN DETAIL WAY





Mike Fogleman

SORT COLOR CELLS INEXCEL
 
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






All times are GMT +1. The time now is 11:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com