Smallest value in multiple ranges

crazyeyeschase

Board Regular
Joined
May 6, 2014
Messages
104
Office Version
  1. 365
Platform
  1. Windows
Needing to search for and highlight the lowest value in columns I, K, and N.

I know it is as simple as selecting the three columns as the range (or even cell I4, K4, and N4) then finding the lowest value in the three cells and highlighting it and then moving to the next row.

I have been playing around but just cannot get things figured out any help will be very helpful.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Last edited:
Upvote 0
I have not been able to get the conditional formatting to work is their any tricks?
 
Upvote 0
This is the closest Ive gotten to what i want on a test document.

Code:
Sub search()
Dim rng As Range
Dim rngData As String
Dim vValue As Variant
Dim rngRow As Range
Dim lngCol As Long
Dim rngAdd As Range


rngData = "I1, K1, N1"

Set rng = Range(rngData)

vValue = Application.WorksheetFunction.Min(rng)

For Each Row In rng.Rows
    If Application.WorksheetFunction.CountIf(Row, vValue) > 0 Then
        lngCol = Application.WorksheetFunction.Match(vValue, Row, 0)
            
        Set rngAdd = rng.Rows.Cells(lngCol, 1)
    
        rngAdd.Select
        
        With Selection
            .Interior.Color = RGB(255, 255, 0)
        End With
        Exit Sub
    End If
Next
End Sub

However this only does one range {A1:E1} not something like (A1, C1, and F1)

Also when it highlights it highlights the cell in column A.

So lets say if the lowest number in the range of A1:E1 is in cell C1 it will highlight cell A3.

It also will not go to say the next row.

Please any help would be great.
So l
 
Upvote 0

Forum statistics

Threads
1,217,005
Messages
6,133,984
Members
449,851
Latest member
laamiejbrown

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