This will add conditional formatting to cells "A2:C8" indicating the smallest number in each row, excluding zeros.

Sub ApplyConditionalFormatting() 

Dim oFormatCondition As FormatCondition

    On Error Resume Next
    Set oFormatCondition = Range("A2:C8").FormatConditions(1)
    On Error GoTo 0

    Set oFormatCondition = Range("A2:C8").FormatConditions.Add( _
        XlFormatConditionType.xlExpression, , _

    With oFormatCondition
        .Interior.Color = RGB(212, 152, 112)
    End With
End Sub

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext