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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,958
Messages
6,175,635
Members
452,661
Latest member
Nonhle

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