Revise Min

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
Evening all

Attempting to modify this script which highlights minimum values in columns 2 to 10 & rows indicated in the "RW" array

The modification would highlight the 3 minimum values within the row ranges.


Thank you guys...


Code:
Dim Rng As Range, r As Double, Col As Long, Rw As Variant, n As Long
For Col = 2 To 10 
Rw = Array(6, 17, 19, 30, 32, 40, 42, 50, 52, 58, 60, 66, 68, 71)
'The range of each borough
For n = 0 To UBound(Rw) Step 2
Set Rng = Range(Cells(Rw(n), Col), Cells(Rw(n + 1), Col))
 
r = Application.Min(Rng)
For Each Min In Rng
If Min.Value = r Then
 
Min.Interior.Color = RGB(253, 249, 215)
Min.Font.Color = RGB(192, 0, 0)
Min.Font.Bold = True
End If
Next Min
Next n
Next Col
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try making these 2 changes
Code:
<del>r = Application.Min(Rng)</del>
r = Application.Small(Rng, 3)
Code:
<del>If Min.Value = r Then</del>
If Min.Value <= r Then
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,710
Members
452,994
Latest member
Janick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top