Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-31-2014, 06:40 PM
excelledsoftware excelledsoftware is offline Is it possible to sort cells in shades of colors? Windows 7 64bit Is it possible to sort cells in shades of colors? Office 2003
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

Yes but you need to do it with VBA. Basically each of those colors has a color index # that you can sort by. You could use this code.
Code:
Sub FillColorIndex()
    'Takes the index of a color and places it in the cell next to the data
        Dim ColorRow As Integer, TotalRows As Integer
        
            TotalRows = WorksheetFunction.CountA(Range("b:b").Rows)
            
            For ColorRow = 2 To TotalRows
                Range("d" & ColorRow).Value = Range("b" & ColorRow).Interior.ColorIndex
            Next ColorRow
            
            MsgBox "All Rows Complete"

End Sub
That will give you a number for each of the colors. Now I am guessing that you want each of those colors to grouped ie. Reds with reds, blues with blues etc. The colorindex will not quite do that but you can sort the numbers and change them as you wish to sort them after.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to sort cells in shades of colors? How to Sort Table Cells from Left to Right tamaracklodge Word Tables 4 03-04-2013 04:00 AM
Is it possible to sort cells in shades of colors? Unable to change font colors from theme colors choy Word 3 08-01-2012 09:12 PM
Is it possible to sort cells in shades of colors? Auto Colors in Cells? Learner7 Excel 5 07-06-2010 10:55 PM
How can I change the colors of cells automatically based on Job Completion? Learner7 Excel 0 07-06-2010 10:47 PM
Count range cells eliminating merge cells danbenedek Excel 0 06-15-2010 12:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft