ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA colorscale and color # (https://www.excelbanter.com/excel-programming/393712-vba-colorscale-color.html)

mistus

VBA colorscale and color #
 
hi,
i have a colorscale (conditional formating ) in range A1:A20 and I'm
trying to get color number for each cell. In normal case

a = Range("a1").Interior.Color
b= Range("a2").Interior.Color etc.

works fine.
But when colors of cells are from conditional formating i dont know
how to get color number.
how to do that?
Mistus


Mike H

VBA colorscale and color #
 
Sadly getting the conditional format colour is not the same as returning the
colorindex. have a look he-

http://www.cpearson.com/excel/CFColors.htm

Mike

"mistus" wrote:

hi,
i have a colorscale (conditional formating ) in range A1:A20 and I'm
trying to get color number for each cell. In normal case

a = Range("a1").Interior.Color
b= Range("a2").Interior.Color etc.

works fine.
But when colors of cells are from conditional formating i dont know
how to get color number.
how to do that?
Mistus



Marcin

VBA colorscale and color #
 
http://www.cpearson.com/excel/CFColors.htm

it did't solve my problem :(. "Function ColorOfCF" is very useful but it
works only for stadnard formating (the same as a =
Range("a1").Interior.Color). maybe I sholud write that I use excel 2007

M




Bob Phillips

VBA colorscale and color #
 
It's not simple but see
http://www.xldynamic.com/source/xld.CFConditions.html

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"mistus" wrote in message
oups.com...
hi,
i have a colorscale (conditional formating ) in range A1:A20 and I'm
trying to get color number for each cell. In normal case

a = Range("a1").Interior.Color
b= Range("a2").Interior.Color etc.

works fine.
But when colors of cells are from conditional formating i dont know
how to get color number.
how to do that?
Mistus




Bob Phillips

VBA colorscale and color #
 
See my post, that site covers formulae as well.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Marcin" wrote in message
...
http://www.cpearson.com/excel/CFColors.htm


it did't solve my problem :(. "Function ColorOfCF" is very useful but it
works only for stadnard formating (the same as a =
Range("a1").Interior.Color). maybe I sholud write that I use excel 2007

M






Mark Lincoln

VBA colorscale and color #
 
For what it's worth, if my VBA code needs to worry about the CF
coloring in a cell, I just make the same tests in VBA as I do in the
CF and go from there.

Mark Lincoln

On Jul 19, 8:47 am, mistus wrote:
hi,
i have a colorscale (conditional formating ) in range A1:A20 and I'm
trying to get color number for each cell. In normal case

a = Range("a1").Interior.Color
b= Range("a2").Interior.Color etc.

works fine.
But when colors of cells are from conditional formating i dont know
how to get color number.
how to do that?
Mistus





All times are GMT +1. The time now is 05:24 PM.

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