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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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,223,705
Messages
6,173,989
Members
452,541
Latest member
haasro02

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