mac7attack
Technical User
Hi,
I have the following code to chagne the the colors of alternating rows. Even rows are colored Green(Index of 4) and odd rows are colored yellow (index of 6). Is there any way to modify these conditions to color Row 1 a different color, say blue (index of 33)?
I have the following code to chagne the the colors of alternating rows. Even rows are colored Green(Index of 4) and odd rows are colored yellow (index of 6). Is there any way to modify these conditions to color Row 1 a different color, say blue (index of 33)?
Code:
Worksheets("Sheet1").Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=0"
Selection.FormatConditions(1).Interior.ColorIndex = 4
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=MOD(ROW(),2)=1"
Selection.FormatConditions(2).Interior.ColorIndex = 6