Highlight Certain cells in the active row

Baz_Man

New Member
Joined
Dec 5, 2008
Messages
11
Hello all, just wondering if this is possible. I have a sheet with sites in Column A. Column B to F are various criteria with Yes or No answers. I'd like to be able to select a site in Column A (Cell A4 for example) and then have every 'Yes' in that route row highlight In a colour to make it stand out. When a different site is selected in a different row I'd like the cross containing Yes on that row to then highligh.

I've searched and can only find a solution that highlights the entire active row rather than just certain cells in it.

Any help would be appreciated.
Cheers
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
You'd need a macro to do that. Open a copy of your workbook. Right click on the sheet tab on the bottom and select View Code. In the window that opens, paste this:

Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Range("B2:F8").Interior.Color = xlNone
    If Intersect(Range("A2:A8"), Target) Is Nothing Then Exit Sub
    For c = 2 To 6
        If Cells(Target.Row, c) = "Yes" Then Cells(Target.Row, c).Interior.Color = vbRed
    Next c
   
End Sub
Change the ranges in red to what your sheet it. Change the vbRed to the color you want, out of these:

vbRed
vbGreen
vbYellow
vbBlue
vbMagenta
vbCyan
vbWhite

If you want a different color, we can do it a different way. Press Alt-Q to close the editor. This is how my test sheet looks when I select A6:

Book4
ABCDEF
1SiteQ1Q2Q3Q4Q5
2PyramidsNoYesNoNoYes
3Great WallYesNoNoYesNo
4Eiffel TowerNoNoNoNoYes
5Statue of LibertyNoYesNoYesNo
6Angor WatYesNoYesNoNo
7UluruYesYesNoNoNo
8KilamanjaroNoNoNoNoYes
Sheet9
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

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