View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Robert H Robert H is offline
external usenet poster
 
Posts: 113
Default Conditional Format formula using VBA

For what its worth I hashed out the easy part of the formula but still
need to replace "C5" with something that references the intersection
of column C with the current row.


Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater,
_
Formula1:="=IF(" & "C5" & "=" & """HL"""
& "," & _
Selection.End(xlDown).Offset(17,
0).Address _
& "," & _
Selection.End(xlDown).Offset(14,
0).Address _
& ")"

With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.Strikethrough = False
End With
Selection.FormatConditions
(1).Interior.ColorIndex = 22