I set the fill color of cells conditionally using the bright yellow color from the default tablet as follows...
Columns("A:A").Select
Range("A1").Activate
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=C1=""[No Product Description]"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
My problem is now trying to "clear the contents" of cells with this color. I've tried all sorts of variations and nothing seems to work. I tired color = 6, color = 27. I tried "Cell.Interior.ColorIndex" as well using different color codes and nothing clears the contents. Here's what I thought should work...
Sub Macro11()
'
' Macro11 Macro
' clear yellow
'
' Keyboard Shortcut: Ctrl+Shift+U
'
For Each Cell In Range("A2:L5000")
If Cell.Interior.Color = 65535 Then
Cell.ClearContents
End If
Next
End Sub
Any suggestions very much appreciated.
Bookmarks