billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Good Morning
The code below highlights the Minimum value in Columns 1 to 4, Rows = Array. Currently working with only one issue. If there is an identical Min value in the specific range the first min value will be the only value highlighted. Stumped on how to highlight both or all identical min values.
Thank You for any assist..
The code below highlights the Minimum value in Columns 1 to 4, Rows = Array. Currently working with only one issue. If there is an identical Min value in the specific range the first min value will be the only value highlighted. Stumped on how to highlight both or all identical min values.
Thank You for any assist..
Code:
Sub MinRange()
Dim Rng As Range, Min As Range, R As Range, Col As Long, Rw As Variant, n As Long
For Col = 1 To 4
Rw = Array(1, 12, 13, 24)
For n = 0 To UBound(Rw) Step 2
Set Rng = Range(Cells(Rw(n), Col), Cells(Rw(n + 1), Col))
Set R = Rng(1)
For Each Min In Rng
If Min.Value < R.Value Then Set R = Min
Next Min
R.Interior.Color = RGB(253, 249, 215)
R.Font.Color = RGB(192, 0, 0)
R.Font.Bold = True
Next
Next Col
End Sub