
Originally Posted by
Leith Ross
The worksheets cells are limited to 56 colors only. If you change the color of a cell to a color not in the palette, it will choose the closest available color.
I don't think that's been the case since around Excel 2003.
If you alter your code to:
For ?? = 1 To 255 Step 7
in the 3 places you have such lines, you should get through the whole range (I doubt you'll be able to tell the difference between two adjacent colours).
Best to start with a virgin workbook each time.
This snippet does something similar:
Sub blah()
Stepsize = 7
Application.ScreenUpdating = False
l = 10
For r = 1 To 255 Step Stepsize
For g = 1 To 255 Step Stepsize
For b = 1 To 255 Step Stepsize
Range("D" & l).Interior.Color = RGB(r, g, b)
Range("E" & l) = "'(" & r & "," & g & "," & b & ")"
l = l + 1
Next b
Next g
Next r
Application.ScreenUpdating = True
End Sub