Hi,
I have a code that deletes text in a set range if the fill-in color is different from yellow (see below).
I would like to change criteria so that text is deleted if fill-in color is different from light grey (not grey but light grey).
I know there are many light greys but let's just choose one.
How would the code change (i.e from vbYellow)?
Thanks,
Nix
I have a code that deletes text in a set range if the fill-in color is different from yellow (see below).
I would like to change criteria so that text is deleted if fill-in color is different from light grey (not grey but light grey).
I know there are many light greys but let's just choose one.
How would the code change (i.e from vbYellow)?
VBA Code:
VBA Code:
Dim c As Range, rng As Range
For Each c In Sheets("Sheet1").Range("B5:E100")
If c.Interior.Color <> vbYellow Then
If Not rng Is Nothing Then
Set rng = Union(rng, c)
Else
Set rng = c
End If
End If
Next
If Not rng Is Nothing Then rng.Clear
Thanks,
Nix