Min Value in column

billandrew

Well-known Member
Joined
Mar 9, 2014
Messages
743
Happy New Year all

Today I have been attempting to apply the following formula (Highlight Min Value) to a range of columns (A:F) using VBA any suggestions.

=(A1<>0)*(A1<=SMALL(A$1:A$50,COUNTIF(A$1:A$50,0)+1))

Could use small without looking for values <>0

Thank You
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi

Are you looking for the min value in the column or the nth smallest value based on how many 0's are in the column?
 
Upvote 0
You can try this

Code:
Sub FindMn()
Dim cCol As Integer
Dim rRow As Integer
For cCol = 1 To 6 ' Columns A to F
    For rRow = 1 To 50 ' Rows 1 to 50
        If Cells(rRow, cCol) = WorksheetFunction.Small(Columns(cCol), 1) Then
            Cells(rRow, cCol).Interior.Color = rgbAqua
        End If
    Next rRow
Next cCol
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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