Conditional Formatting in Multiple Columns

dbuzo

New Member
Joined
Sep 29, 2014
Messages
10
Good morning,
I want to highlight an entire row if specific text is entered in a cell. For example, each row has data for employees. Column B has the role of the employee (primary, secondary, supervisor). If "primary" is in column B then I want the entire row highlighted (or at least their name) to be formatted as well. Is this possible?
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

ChrisBM

Board Regular
Joined
Sep 22, 2014
Messages
215
Code:
'Put in start and end rows for 1 and 100
For i = 1 to 100
       If Range("B" & i).Value = "primary" Then
             Rows(i & ":" & i).Select
                            'Highlight row
                            With Selection.Interior                   
                                             .Pattern = xlSolid
                                             .PatternColorIndex = xlAutomatic
                                             .ThemeColor = xlThemeColorDark2
                                             .TintAndShade = -0.249977111117893
                                             .PatternTintAndShade = 0
                         End With
        End If
Next
 

Special-K99

Well-known Member
Joined
Nov 7, 2006
Messages
8,350
Select B1

Conditional Formatting
New Rule
Use a formula to determine...

=($B1="primary")

format as required
Use Format painter (paintbrush icon) to copy to other cells
 

Watch MrExcel Video

Forum statistics

Threads
1,108,986
Messages
5,526,065
Members
409,685
Latest member
Davetom

This Week's Hot Topics

Top