Search : in
By :

Sorting by color in Excel 2002

Howedoin, on Nov 3, 2009 6:15:06 pm GMT 
 Report this message to moderators

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

Best answers for « Sorting by color in Excel 2002 » in :
Colouring cells on conditions ShowColouring cells on conditions There are many pratical functions under Excel which is not commonly used. Example: If you wish a cell automatically turns red (or other formatting border, frame etc) under one condition: a result, a...
Basic Excel Formulas ShowBasic Excel Formulas Below are some basic formulas for Microsoft excel: Basic formula : ADDITION cell A1 to A10 = sum (A1: A10) AVERAGE cell A1 to A10 = average (A1: A10) MAXIMUM cell A1 to A10 = max (A1: A10) MINIMUM...
VB6 Finding the RGB values of a color ShowVB6 Finding the RGB values of a color Dim R as integer Dim G as integer Dim B as integer Sub FindRGB(Col As Long) R = &HFF& And Col G = (&HFF00& And Col ) \ 256 B = (&HFF0000 And Col ) \ 65536 End Sub Note: Here...
Download XLS (Excel) to DBF Converter ShowDescription The application is designed by WhiteTown Software. XLS (Excel) to DBF Converter is a tool that enables you to convert your XLS files to DBF format quickly and easily. Simple and easy to use, the application has been awarded from various...
Spreadsheets - The Excel Interface ShowExcel Introduction Microsoft Excel is the spreadsheet in the Microsoft Office office suite. To start it, simply click on the appropriate icon in the Start menu (in Windows) or click on an Excel file (that has an .xls file extension). A Excel...