View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davethewelder davethewelder is offline
external usenet poster
 
Posts: 62
Default Conditional Format overwrighting previous conditional format

Hi, I am trying to format a sheet with three conditional formats but when I
get to the second Conditional Format it is overwrighting previous conditional
format.
I don't understand why this is happening. Anyone any ideas? Code added
below.

Cells.Select
Range("A12").Activate
Application.CutCopyMode = False
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=$B$66"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 5
End With
'Cells.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,
Formula:="=$F$66"
' Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="=$F$66"
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = xlAutomatic
End With

Thanks in advance.
Davie