Differences concerning BackColor and ColorIndex

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top