+ Reply to Thread
Results 1 to 4 of 4

Sorting by Format?

  1. #1
    Registered User
    Join Date
    12-27-2005
    Posts
    72

    Sorting by Format?

    ....this may be a candidate for dumbest question of the year on this board but, here goes, - is it possible to sort by format features such as highlighting for instance ... i have a table with rows highlighted in different colors for certain reasons and need to organize them based on that highlighting, cant seem to figure out how to do that if its even possible?


  2. #2
    Bernard Liengme
    Guest

    Re: Sorting by Format?

    I have copied this function from http://www.cpearson.com/excel/colors.htm

    Function CellColorIndex(InRange As Range, Optional _
    OfText As Boolean = False) As Integer
    '
    ' This function returns the ColorIndex value of a the Interior
    ' (background) of a cell, or, if OfText is true, of the Font in the cell.
    '
    Application.Volatile True
    If OfText = True Then
    CellColorIndex = InRange(1,1).Font.ColorIndex
    Else
    CellColorIndex = InRange(1,1).Interior.ColorIndex
    End If

    End Function

    Use Tools|Macro|VBA Editor and then Insert|Module; copy this to the module
    window

    In an unused column call the function with a formula like
    =CELLCOLORINDEX(A1,FALSE)

    Copy down the column and use this as your sorting criterion
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "RalphSE" <RalphSE.24m62z_1142262901.345@excelforum-nospam.com> wrote in
    message news:RalphSE.24m62z_1142262901.345@excelforum-nospam.com...
    >
    > ...this may be a candidate for dumbest question of the year on this
    > board but, here goes, - is it possible to sort by format features such
    > as highlighting for instance ... i have a table with rows highlighted
    > in different colors for certain reasons and need to organize them based
    > on that highlighting, cant seem to figure out how to do that if its even
    > possible?
    >
    >
    >
    >
    > --
    > RalphSE
    > ------------------------------------------------------------------------
    > RalphSE's Profile:
    > http://www.excelforum.com/member.php...o&userid=29931
    > View this thread: http://www.excelforum.com/showthread...hreadid=521727
    >




  3. #3
    Jim Cone
    Guest

    Re: Sorting by Format?

    The next version of Excel will be able to sort by color.
    You will have to wait to near the end of the year for its release.

    The Chip Pearson color sorting code will not work on cells that
    have been colored using conditional formatting.

    Jim Cone
    San Francisco, USA
    http://www.officeletter.com/blink/specialsort.html
    http://www.realezsites.com/bus/primitivesoftware


    "RalphSE" wrote in message...
    ....this may be a candidate for dumbest question of the year on this
    board but, here goes, - is it possible to sort by format features such
    as highlighting for instance ... i have a table with rows highlighted
    in different colors for certain reasons and need to organize them based
    on that highlighting, cant seem to figure out how to do that if its even
    possible?

    RalphSE


  4. #4
    Registered User
    Join Date
    12-27-2005
    Posts
    72
    thanks! but it doesnt appear to be working correctly, is is giving inconsistent values, for example - it is returning the value 15 for red highlighting with black text as well as no highlighting with black text, i am just going to add a column and manually put in a number corresponding to the color value so i can sort it that way, but thanks kindly for your help...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1