Consulting

Results 1 to 8 of 8

Thread: How to define my own standard colors?

  1. #1
    VBAX Regular
    Joined
    Jan 2008
    Posts
    28
    Location

    How to define my own standard colors?

    Hi All,

    I would like to have an add-in with its own color pattern. How to do this? Has someone an example at hand? Very much appreciated.

    Alexander

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Tools>Options>Color allows you to modify the colour pallette, so just go in and change them, then save that workbook.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Jan 2008
    Posts
    28
    Location
    I need to set up it in the vba code. What are the command I have to use for this? Is there some infor detailing this?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    ActiveWorkbook.Colors(54) = RGB(255, 0, 102)
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Jan 2008
    Posts
    28
    Location
    Thank you!
    Can you advise which colox box out of those depicted in the dialog box (Tools>Option>Colors) will have the color like this (if my code is ActiveWorkbook.Colors(54) = RGB(255, 0, 102))? How to define the colors for fills and lines?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That applies to all colours, there is only one 56 colour pallette.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,728
    Location
    Good writeup and example of the standard 56 colors

    http://support.softartisans.com/kbview_1205.aspx


    Be aware that someone else may have redefined one of the colors in the palette, and since cell and graph fills/lines use the .ColorIndex property, and not the .Color property, you'll get the current color for e.g. 54

    Paul

  8. #8
    VBAX Regular
    Joined
    Jan 2008
    Posts
    28
    Location
    Thank you, Paul!

Posting Permissions

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