Can this code be modified to limit the number of rows that are affected / colored.
Also, is there some type of index of available colors. I have the code that will return the number of a cell's color but would like to find more color options.
Thanks all!
Sub ColorRange()
Dim Range1 As Range
Dim gray As String
For Each Range1 In Sheet1.Range("G11", Sheet1.Range("G11").End(xlDown))
If gray = "Yes" Then
Sheet1.Range(Range1.Offset(0, -5), Range1.Offset(0, 6)).Interior.ColorIndex = 36
gray = "No"
Else
gray = "Yes"
End If
Next
End Sub
Also, is there some type of index of available colors. I have the code that will return the number of a cell's color but would like to find more color options.
Thanks all!
Sub ColorRange()
Dim Range1 As Range
Dim gray As String
For Each Range1 In Sheet1.Range("G11", Sheet1.Range("G11").End(xlDown))
If gray = "Yes" Then
Sheet1.Range(Range1.Offset(0, -5), Range1.Offset(0, 6)).Interior.ColorIndex = 36
gray = "No"
Else
gray = "Yes"
End If
Next
End Sub