+ Reply to Thread
Results 1 to 3 of 3

find largest number in a range and change font to bold

  1. #1
    Registered User
    Join Date
    06-19-2009
    Location
    new york, new york
    MS-Off Ver
    Excel 2003
    Posts
    2

    find largest number in a range and change font to bold

    I need to create a macro that will examine a range of cells, for example D12:T12, find the cell with the largest number value in that range then set the font for that cell to bold (or red, or change the cell background color). Can someone show me the code to do this? Thank you!
    Last edited by NBVC; 06-19-2009 at 03:51 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: find largest number in a range and change font to bold

    You can easily use Conditional Formatting with no code...

    Select the range, eg. D12:T12

    and go to Format|Conditional Formatting

    Select Formula Is from 1st drop down and enter formula: =D12=Max($D12:$T12)

    Note the First D12 denotes the top-left most cell in your selection....so you can apply this to multiple rows at once, checking each row for the max in that row....

    Click Format and choose from the Font or Pattern Tab.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-19-2009
    Location
    new york, new york
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: find largest number in a range and change font to bold

    Thanks a million "NBVC" !!!
    I would never have thought it would be that easy!

+ 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