Hi everyone,
I need to color in a different color each row, where I have more than 500 rows in my range.
The loop below stops after about ~50 rows. I guess this is because VBA have just about 50 different colors.
*My question: how to change the loop so it repeats the loop after finish the first 50 colors *
P.S. I don't mind to have again colorindex = 3 after 47 different colors.
Thanks!
![]()
Dim ci As Byte ci = 3 With ws For Each ct In .Range("t11:t" & .UsedRange.Rows.Count) If ct = ct.Offset(1, 0) Then ct.Font.ColorIndex = ci If ct = ct.Offset(-1, 0) Then ct.Font.ColorIndex = ci ci = ci + 1 Next ct End With
Bookmarks