Dec 7, 2001 #1 steveave Technical User Jun 4, 2001 60 US Is there a way to sort cells by the color of the cell or the color of the text/number within the cells?
Is there a way to sort cells by the color of the cell or the color of the text/number within the cells?
Dec 7, 2001 #2 JVFriederick IS-IT--Management Mar 19, 2001 517 US The following code will read the text color from column B and write the color value to column A. Sub ColorCodes() For IntR = 1 To 1000 ActiveSheet.Rows(IntR).Columns(1) = ActiveSheet.Rows(IntR).Columns(2).Font.ColorIndex Next IntR End Sub You can then sort your data by using column A. Hope this helps. Upvote 0 Downvote
The following code will read the text color from column B and write the color value to column A. Sub ColorCodes() For IntR = 1 To 1000 ActiveSheet.Rows(IntR).Columns(1) = ActiveSheet.Rows(IntR).Columns(2).Font.ColorIndex Next IntR End Sub You can then sort your data by using column A. Hope this helps.