Results 1 to 3 of 3

Thread: Color Coding Stops After I get to # 65,282

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,970
    Quote Originally Posted by Leith Ross View Post
    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
    Last edited by p45cal; 02-16-2018 at 06:34 AM.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •