Sort a worksheet by Colour
Results 1 to 2 of 2

Thread: Sort a worksheet by Colour
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2013
    Posts
    63
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Sort a worksheet by Colour

    Morning all

    I have a worksheet "Project Summary" Columns A to L which is a summary of another worksheet "Project Master" Columns A to BW. ONce the data is pulled through from "Project Master" I am using the following code to sort the "Project Summary" sheet:

    Code:
    Sub SortMultipleColumns()
    With Worksheets("Project Summary").Sort
         .SortFields.Add Key:=Range("B1", Cells(Rows.count, "B").End(xlUp)), Order:=xlAscending
         .SortFields.Add Key:=Range("A1", Cells(Rows.count, "A").End(xlUp)), Order:=xlAscending
         .SetRange Range("A1:L100")
         .Header = xlYes
         .Apply
    End With
    End Sub
    The final thing I would like this worksheet to be sorted by is colours in Column K in the following order Red, Amber and then Green. Any ideas?

    Thank

    Steve

  2. #2
    Moderator mole999's Avatar
    Join Date
    Oct 2004
    Location
    UK
    Posts
    9,828
    Post Thanks / Like
    Mentioned
    16 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Sort a worksheet by Colour

    I think from 2007 you can sort by colour, I'm in 2013 and can't see backwards
    • Yes I know there are better ways to do it. I just wish I knew them. - 97, 2003, 2007, 2010, 2013, 2016 & 2019
    • I wear my ignorance openly, excel is not my chosen career, its a means to an ends
    • Posting Guidelines Want to post well laid out questions and answers Translate Excel Versions
      Code:
      [CODE ]Put Your Code[/ CODE]
    • Settings > General Settings (on the left) scroll to the bottom, > Miscellaneous Options > Use ENHANCED
    • X-Posting Guidelines Rule 13 > CHART STUFF

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •