+ Reply to Thread
Results 1 to 4 of 4

Differences concerning BackColor and ColorIndex

  1. #1
    Peres
    Guest

    Differences concerning BackColor and ColorIndex

    I ‘d like to change a line color depending on the Backcolor of a OptionButton
    but when I ask :
    Color1 = OptionButton1.BackColor

    The result do not match to:
    Range("AF16").Interior.ColorIndex = Color1

    Does sameone knows how can I make it works?

    Tanks a lot
    Peres

    --
    Peres

  2. #2
    Tim Williams
    Guest

    Re: Differences concerning BackColor and ColorIndex

    Color is a long (RGB) value and ColorIndex is the index (position) of a
    color in the workbook color table.

    Try:

    Range("AF16").Interior.Color = Color1

    Note that if you try to set a cell interior color to one which is not in the
    workbook color table then Excel will use the "closest" color from the table
    instead.


    Tim

    --
    Tim Williams
    Palo Alto, CA


    "Peres" <[email protected]> wrote in message
    news:[email protected]...
    > I 'd like to change a line color depending on the Backcolor of a

    OptionButton
    > but when I ask :
    > Color1 = OptionButton1.BackColor
    >
    > The result do not match to:
    > Range("AF16").Interior.ColorIndex = Color1
    >
    > Does sameone knows how can I make it works?
    >
    > Tanks a lot
    > Peres
    >
    > --
    > Peres




  3. #3
    Peres
    Guest

    Re: Differences concerning BackColor and ColorIndex

    Tanks a lot . You dont imagine how much you help me!
    --
    Peres


    "Tim Williams" wrote:

    > Color is a long (RGB) value and ColorIndex is the index (position) of a
    > color in the workbook color table.
    >
    > Try:
    >
    > Range("AF16").Interior.Color = Color1
    >
    > Note that if you try to set a cell interior color to one which is not in the
    > workbook color table then Excel will use the "closest" color from the table
    > instead.
    >
    >
    > Tim
    >
    > --
    > Tim Williams
    > Palo Alto, CA
    >
    >
    > "Peres" <[email protected]> wrote in message
    > news:[email protected]...
    > > I 'd like to change a line color depending on the Backcolor of a

    > OptionButton
    > > but when I ask :
    > > Color1 = OptionButton1.BackColor
    > >
    > > The result do not match to:
    > > Range("AF16").Interior.ColorIndex = Color1
    > >
    > > Does sameone knows how can I make it works?
    > >
    > > Tanks a lot
    > > Peres
    > >
    > > --
    > > Peres

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Differences concerning BackColor and ColorIndex

    Another source of information:

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

    David McRitchie's page on colors and Excel.

    --
    Regards,
    Tom Ogilvy


    "Peres" <[email protected]> wrote in message
    news:[email protected]...
    > Tanks a lot . You dont imagine how much you help me!
    > --
    > Peres
    >
    >
    > "Tim Williams" wrote:
    >
    > > Color is a long (RGB) value and ColorIndex is the index (position) of a
    > > color in the workbook color table.
    > >
    > > Try:
    > >
    > > Range("AF16").Interior.Color = Color1
    > >
    > > Note that if you try to set a cell interior color to one which is not in

    the
    > > workbook color table then Excel will use the "closest" color from the

    table
    > > instead.
    > >
    > >
    > > Tim
    > >
    > > --
    > > Tim Williams
    > > Palo Alto, CA
    > >
    > >
    > > "Peres" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I 'd like to change a line color depending on the Backcolor of a

    > > OptionButton
    > > > but when I ask :
    > > > Color1 = OptionButton1.BackColor
    > > >
    > > > The result do not match to:
    > > > Range("AF16").Interior.ColorIndex = Color1
    > > >
    > > > Does sameone knows how can I make it works?
    > > >
    > > > Tanks a lot
    > > > Peres
    > > >
    > > > --
    > > > Peres

    > >
    > >
    > >




+ 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