abc xyz zyz
100 90 80 zyz
50 60 70 abc
Have a formula that quotes the supplier at
cell D2 , is there a macro that will highlight
the minimum value each line that is 80 and
50 to be highlighted
Yes I know =min(a2:d2) will do the work
abc xyz zyz
100 90 80 zyz
50 60 70 abc
Have a formula that quotes the supplier at
cell D2 , is there a macro that will highlight
the minimum value each line that is 80 and
50 to be highlighted
Yes I know =min(a2:d2) will do the work
Here is one way to do it:
![]()
Sub Highlight_Min() Dim ws As Worksheet: Set ws = Sheets("Sheet1") 'you may need to change this Dim i As Long, minValue As Long Dim rCell As Range For i = 2 To ws.Range("D" & Rows.Count).End(xlUp).Row minValue = Application.WorksheetFunction.Min(ws.Range("A" & i, "D" & i)) 'assuming column A to D as per post For Each rCell In ws.Range("A" & i, "D" & i) If rCell.Value = minValue Then rCell.Interior.ColorIndex = 6 Exit For End If Next rCell Next i End Sub
Yes , would imagine how automated that would
be if had real raw data going on it , thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks