View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John Keith John Keith is offline
external usenet poster
 
Posts: 172
Default conditional format - put inside a for/next loop

I would like to conditional format some cells all in the same column
with the following:

Cells(31,4).Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=C31=1"
Selection.FormatConditions(1).Interior.ColorIndex = 38

But I want to put this piece of code inside a For/Next loop to change
a large number of rows. I think I know how to change the first line
but I need to know how to change formula statement so it will work
within the loop. (The fill color of column D is determined by the
value of column C cell in the same row.)

Using excel 2003/WinXP


John Keith