+ Reply to Thread
Results 1 to 4 of 4

finding a min value (real number) & colour cell

  1. #1
    Registered User
    Join Date
    01-24-2007
    Posts
    1

    finding a min value (real number) & colour cell

    Hi,
    Can any one help me with a macro for looking down a cloumn of numbers(the numbers are real, eg 23.68), finding the minimum value and asigning a colour to that cell.
    Thanks

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    You might not need a macro

    You can use a formula in conditional formatting

    Cell Value is equal to =MIN($D$4:$D$7)

    for example
    Martin

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    I was thinking the same thing Martin, but that doesn't work (well, at least not in Excel 97 ). All cells in the range were formatted based on the conditional format.

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Here's a macro way of doing it

    Sub Test()
    MinNumber = 1E+18
    For Each Cell In Selection
    If IsNumeric(Cell) Then
    If Cell < MinNumber Then
    MinNumber = Cell
    MinCellAddress = Cell.Address
    End If
    End If
    Next Cell
    If MinCellAddress <> "" Then
    Range(MinCellAddress).Interior.ColorIndex = 3
    End If
    End Sub

+ 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