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?
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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