w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Search for string on cell starting with two specific letters and highlight entire row

This one works for me:

Sub color1()
    'change Sheet1 to suit
    With ThisWorkbook.Worksheets("Sheet1").Range("A:Z").FormatConditions
        .Add Type:=xlExpression,
        .Item(1).Interior.ColorIndex = 4 'green
        .Add Type:=xlExpression,
        .Item(2).Interior.ColorIndex = 6 'yellow
    End With
End Sub

enter image
description here

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.