+ Reply to Thread
Results 1 to 3 of 3

Customizing colors

  1. #1
    Forum Contributor
    Join Date
    10-04-2004
    MS-Off Ver
    2013
    Posts
    148

    Customizing colors

    Hi!

    I've used the following code to change the cell color.

    Sub dfghrth()

    ActiveCell.Interior.Color = RGB(221, 255, 221)

    End Sub



    But instead of actually changing to the color I've defined, it changes to a pallette default color...

    Help anyone?

  2. #2
    Tom Ogilvy
    Guest

    RE: Customizing colors

    A worksheet can only display 56 predefined colors (the palette).

    You will need to redefine the palette to provide the colors you need or you
    will get the behavior you describe.

    http://www.mvps.org/dmcritchie/excel/colors.htm

    A posible workaround is to use a shape/autoshape instead of a cell as these
    can display more simultaneous colors.

    --
    Regards,
    Tom Ogilvy



    "pmguerra" wrote:

    >
    > Hi!
    >
    > I've used the following code to change the cell color.
    >
    > Sub dfghrth()
    >
    > ActiveCell.Interior.Color = RGB(221, 255, 221)
    >
    > End Sub
    >
    >
    >
    > But instead of actually changing to the color I've defined, it changes
    > to a pallette default color...
    >
    > Help anyone?
    >
    >
    > --
    > pmguerra
    > ------------------------------------------------------------------------
    > pmguerra's Profile: http://www.excelforum.com/member.php...o&userid=14986
    > View this thread: http://www.excelforum.com/showthread...hreadid=542600
    >
    >


  3. #3
    Harald Staff
    Guest

    Re: Customizing colors

    You have to change the pallette, Excel has no more than 56 colors to work
    with:

    If ActiveCell.Interior.ColorIndex > 2 Then _
    ActiveWorkbook.Colors(ActiveCell.Interior.ColorIndex) = _
    RGB(221, 255, 221)

    HTH. Best wishes Harald

    "pmguerra" <[email protected]> skrev i
    melding news:[email protected]...
    >
    > Hi!
    >
    > I've used the following code to change the cell color.
    >
    > Sub dfghrth()
    >
    > ActiveCell.Interior.Color = RGB(221, 255, 221)
    >
    > End Sub
    >
    >
    >
    > But instead of actually changing to the color I've defined, it changes
    > to a pallette default color...
    >
    > Help anyone?
    >
    >
    > --
    > pmguerra
    > ------------------------------------------------------------------------
    > pmguerra's Profile:

    http://www.excelforum.com/member.php...o&userid=14986
    > View this thread: http://www.excelforum.com/showthread...hreadid=542600
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1