+ Reply to Thread
Results 1 to 8 of 8

conditional formatting question

  1. #1
    Registered User
    Join Date
    09-27-2004
    Posts
    17

    conditional formatting question

    Hi,
    I have data supplied to me as: 36/40. In this example, 36 is a person's average score & 40 is the most recent score. In a column of such figures, is it possible to have conditional formatting highlight just the highest recent score? I realize the simplest solution is to split these figures into 2 columns, but would rather rather keep them intact if possible.

    Fujimi-cho

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Don't think you can with CF.

    Here's a macro that bolds the last 2 digits if greater than the first 2 for each cell in your selection

    Link on where to add code

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Hi Fujimi-cho,

    This can't be done by just using Excel's Conditional Format option. But with VBA it is possible as you can see in the attached file.

    Select the range with scores and click the button.

    Succes,
    Erik
    Attached Files Attached Files
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    I assume you don't want to press a button so try this event macro

    You can either open the attached example or right click your sheet tab > select view code and paste in the below. It works on Col A and makes it bold and red ColorIndex 3.

    Please Login or Register  to view this content.
    VBA Noob
    Attached Files Attached Files

  5. #5
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    You don't take into account the possibility that the scores are < 10 and/or > 99 VBA Noob.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thanks WinteE,

    Now amended

    Please Login or Register  to view this content.
    VBA Noob

  7. #7
    Registered User
    Join Date
    09-27-2004
    Posts
    17
    Thanks to VBA Noob & winteE; y'all confirmed my doubts about conditional formatting doing the job. I'll give your suggestions a try!

    Fujimi-cho

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Not necessarily simple perhaps but you could use conditional formatting to format the cell containing the highest most recent score.

    Assume your data is in A1:A10, can contain blanks and data of the format x/y where x and y are positive integers.

    Select A1:A10 with A1 active cell and use conditional formatting with this formula

    =MID(A1,FIND("/",A1)+1,9)+0=MAX(IF(A$1:A$10<>"",MID(A$1:A$10,FIND("/",A$1:A$10)+1,9)+0))

+ 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