Highlight Min Separate Ranges

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
Good evening

Is there a way to highlight min value in separate ranges.

I am utilizing some code provided from an earlier thread. Could I use the following repeated?

The code is

Sub FormatMin()
Dim Col As Integer
Dim Row As Integer
Dim Row2 as Integer
For Col = 1 To 11
For Row = 1 To 8
For Row2 = 9 to 18
If Cells(Row, Col) = WorksheetFunction.Small(Columns(Col), 1) Then
Cells(Row, Col).Font.Bold = True
End If
Next Row
Next Col
Next Range
If cells(Row2,Col) =WorksheetFunction.Small(Columns(Col),1)Then
Cells(Row2,Col).Font.Bold = True
End If
Next Row2
Next Col
End Sub

<colgroup><col width="70" style="width:53pt"> </colgroup><tbody>
</tbody>
 
You're welcome:-
"Do arrays need to be declared" If you normally declare your variables then "Yes".:- Google "Option Explicit"

The code works as below:-
The code First loops through the variant array "RW", NB:- The first index Value in "Rw" is 0.
At each loop of "Rw" the Range "Rng" is set.
This enables each range specified in "RW" to be looped through individually.
The variable "R" is first set to the first value in "Rng" Range, then in the loop "For each dn ..." , each value in "Rng" is compared to "R" to find lowest value. At the end of the "Dn" loop the variable "R" will have the lowest value.
As "R" is a range variable, "R" will have the "address"property, so we can give that cell the colour "Yellow.
This method is repeated for each "Rng" range.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Providing the explanation, in my opinion is the key to the learning process.

You and this forum are a tremendous resource in that process.

Thank you again!
 
Upvote 0

Forum statistics

Threads
1,215,949
Messages
6,127,877
Members
449,410
Latest member
adunn_23

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