Changing row colour if text string present in a cell?
Maybe you can use this:
With Range(x)
.FormatConditions.Add Type:=xlCellValue,
Operator:=xlEqual, """
.FormatConditions(1).Interior.Color = vbYellow
End With
But this will only color the given cell
To color the entire row adding this should work (maybe
put it under the Worksheet.Change event):
If Range(x).Interior.Color=vbYellow then
rows(Range(x).Row).Interior.Color=vbYellow
End If
-----Original Message-----
I'm hoping that something like this can be done: if any
email address
in a worksheet has a certain text string in it, in this
case
", what would the conditional formatting code
be that will
then colour that row yellow, if this is indeed
possible? The rows go
from 2 to 15, if that info is needed, i.e., A2 to A15,
B2 to B15, etc.
(or if necessary, if it's easier to just code the entire
row, that
would be acceptable, too, rather than the area of row
that is visible
in the sheet).
What this would do is to signal records of people that
are inside the
organization vs other govt departments.
Thanks much. Appreciate the help.
.
|