+ Reply to Thread
Results 1 to 9 of 9

find n highlight max value

  1. #1
    Registered User
    Join Date
    08-24-2006
    Posts
    61

    find n highlight max value

    I have

    A
    1 2.22
    2 2.23
    3 2.33
    4 1.44
    5 3.44

    at A6 i putting the formula to find out the max value at A
    =MAX(A1:A5)
    which is = 3.44

    My question is
    how to make the system highlited the max value for me
    I mean, highlight the cell A5 after find out it is the max value.
    So that i know where is the max value located.
    Because i have thousands of numbers...which make me headache to find it out

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445
    Hi,

    This code will turn the maximum in a selected range green

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    08-24-2006
    Posts
    61
    where to insert the code?
    sorry..

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445
    No worries,

    With your workbook open, press ALT & F11 to open the VB editor

    Go to Insert > Module

    paste the code into the window that appears.

    Close the VB editor.

    In your workbook, highlight the range in which you want the highlight to appear, then go to Tools>Macro>Run Macro, and select highlightmax

    Dave

  5. #5
    Registered User
    Join Date
    08-24-2006
    Posts
    61
    thanks...it works preety

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858
    alternatively, you could use conditional formatting. Format->Conditional formatting._> formula is =A1=$A$6->Set format.

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    If your only using A6 to determine the max value so it can be colored, but don't need it for anything else, skip using that cell altogether and use the conditional format

    =A1=MAX($A$1:$A$5)

  8. #8
    Registered User
    Join Date
    04-26-2007
    Posts
    77
    If I have following two columns

    Class-----Rollno
    --7-------15
    --7-------16
    --7-------18
    --9-------22
    --9-------25
    --9-------28
    --10------1

    Now I want to highlight every row that has max rollno in every class e.g
    --7-------18
    --9-------28
    --10------1

    How to highlight above rows with macro

  9. #9
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    You should have started a new thread for this, but this conditional format should work for you..

    1. Select your data cells, let's assume it's in A2 through B50.
    2. Click Format -> Conditional Formatting...
    3. In the drop-down list, select 'Formula Is'
    4. In the formula box, copy and paste this formula:
    Please Login or Register  to view this content.
    5. Click the Format... button and set your formatting (background color, font color, etc.)
    6. Click OK

    Your class that has the maximum rollno value should now be formatted as you chose.

    If your range of data is larger, simply change the $A$2:$A$50 and $B$2:$B$50 to your range.

    UPDATE: Amended formula to a shorter one that works.
    Last edited by Paul; 05-22-2007 at 10:41 PM.

+ 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