P
Photo.Man.82
Hey guys, I'm trying to set up a macro using conditional formatting so
that an entire row of a worksheet will be highlighted if a particular
column's cell has the word "yes" in it.
For example, if there are any cells in column T that have the word
"yes" in them, I'd like Excel to automatically highlight that row
yellow. I found a solution online, but I need help tweaking it.
Here's what I've got:
Sub Highlight()
[T1].Activate
With Range([T1], [T65536].End(xlUp)).EntireRow
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$T1=""yes"""
.FormatConditions(1).Interior.ColorIndex = 6
End With
End Sub
I'd like to change the range function to search every column in the
worksheet, instead of just column T. I just don't know enough about
VBA to do this.
Also, let's say I wanted to search three columns, like R, S, and T,
instead of every single column, how would the macro be written? Thanks
in advance!
-Drew
that an entire row of a worksheet will be highlighted if a particular
column's cell has the word "yes" in it.
For example, if there are any cells in column T that have the word
"yes" in them, I'd like Excel to automatically highlight that row
yellow. I found a solution online, but I need help tweaking it.
Here's what I've got:
Sub Highlight()
[T1].Activate
With Range([T1], [T65536].End(xlUp)).EntireRow
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$T1=""yes"""
.FormatConditions(1).Interior.ColorIndex = 6
End With
End Sub
I'd like to change the range function to search every column in the
worksheet, instead of just column T. I just don't know enough about
VBA to do this.
Also, let's say I wanted to search three columns, like R, S, and T,
instead of every single column, how would the macro be written? Thanks
in advance!
-Drew