ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I get RGB color values? (https://www.excelbanter.com/excel-programming/284174-how-can-i-get-rgb-color-values.html)

Philip Reece-Heal[_3_]

How can I get RGB color values?
 
mycolor = ActiveCell.Offset(0, 1).Interior.Color
ActiveCell.Value = mycolor

The above code gives me the integer color values (which I don't understand)
for the cell to the right of the active cell and the following code gives me
the color palette numbers:

mycolor = ActiveCell.Offset(0, 1).Interior.ColorIndex
ActiveCell.Value = mycolor

How can I get the RGB color values


Any info gratefully appreciated

Philip



Chip Pearson

How can I get RGB color values?
 
Philip,

See www.cpearson.com/excel/colors.htm for VBA code to break the
Long color value in to its red, green, and blue components.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Philip Reece-Heal" wrote in
message . ..
mycolor = ActiveCell.Offset(0, 1).Interior.Color
ActiveCell.Value = mycolor

The above code gives me the integer color values (which I don't

understand)
for the cell to the right of the active cell and the following

code gives me
the color palette numbers:

mycolor = ActiveCell.Offset(0, 1).Interior.ColorIndex
ActiveCell.Value = mycolor

How can I get the RGB color values


Any info gratefully appreciated

Philip





John Wilson

How can I get RGB color values?
 
Phillip,

Just about everything you wanted to know about colors:
http://www.mvps.org/dmcritchie/excel/colors.htm

John

Philip Reece-Heal wrote:

mycolor = ActiveCell.Offset(0, 1).Interior.Color
ActiveCell.Value = mycolor

The above code gives me the integer color values (which I don't understand)
for the cell to the right of the active cell and the following code gives me
the color palette numbers:

mycolor = ActiveCell.Offset(0, 1).Interior.ColorIndex
ActiveCell.Value = mycolor

How can I get the RGB color values

Any info gratefully appreciated

Philip



John Wilson

How can I get RGB color values?
 
Phillip,

Well, almost everything.
Forgot to mention Chip's site too

John

John Wilson wrote:

Phillip,

Just about everything you wanted to know about colors:
http://www.mvps.org/dmcritchie/excel/colors.htm

John

Philip Reece-Heal wrote:

mycolor = ActiveCell.Offset(0, 1).Interior.Color
ActiveCell.Value = mycolor

The above code gives me the integer color values (which I don't understand)
for the cell to the right of the active cell and the following code gives me
the color palette numbers:

mycolor = ActiveCell.Offset(0, 1).Interior.ColorIndex
ActiveCell.Value = mycolor

How can I get the RGB color values

Any info gratefully appreciated

Philip



Philip Reece-Heal[_3_]

How can I get RGB color values?
 


Many thanks John
Plenty of stuff to get me to where I was wanting to go

All the best
Philip

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Philip[_5_]

How can I get RGB color values?
 


Many thanks Chip
Plenty of stuff to get me to where I was wanting to go and some way
further

All the best
Philip

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com