Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet backcolor within range Stanley Excel Discussion (Misc queries) 2 January 25th 06 09:33 PM
Change BackColor Steve Excel Programming 1 July 11th 05 04:09 PM
TextBox BackColor Lenny_821[_11_] Excel Programming 6 June 15th 05 06:13 PM
Changing backcolor of commandbutton scottnshelly[_21_] Excel Programming 2 April 22nd 04 11:27 PM
Pivot DataRange BackColor Charly[_3_] Excel Programming 2 April 18th 04 02:08 PM


All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"