ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel Cell Criteria Effect (https://www.excelbanter.com/excel-worksheet-functions/55919-excel-cell-criteria-effect.html)

raymond chiu

Excel Cell Criteria Effect
 
Dear Helper,

First of all , thanks for your attention. I have one question.

Using VB, I need to check the background color of one cell in the Excel,
e.g. A1.
How can I know in the command, e.g. range("A1").????

Moreover, if this cell has formating or some criteria, e.g. if the value is
larger than one
number, then show it in yellow.
Would this effect or cannot give the value???

As We find that the cell show red font but .range("A1").font.color show "0".

That is why I asked such a question.


Thanks for your attention.

Raymond Chiu





Bob Phillips

Excel Cell Criteria Effect
 


"raymond chiu" wrote in message
...
Dear Helper,

First of all , thanks for your attention. I have one question.

Using VB, I need to check the background color of one cell in the Excel,
e.g. A1.
How can I know in the command, e.g. range("A1").????


Range("A1").Inter5ior.Colorindex

Moreover, if this cell has formating or some criteria, e.g. if the value

is
larger than one
number, then show it in yellow.
Would this effect or cannot give the value???


This is best achieved with Conditional Formatting. Check it out in help.

As We find that the cell show red font but .range("A1").font.color show

"0".

Don't understand. Range("A1") is a cell, so what do you mean by can cell be
red but A1 font colour be "0"?



raymond chiu

Excel Cell Criteria Effect
 
Dear Bob Phillips,

I mean the cell(e.g. A1) font color is red which is done by conditional
formating.
But when I use VB Program to see this cell font color (A1) , it shows "0"
which is same as black.

When I right click the cell A1 and choose "Format Cell", it show black in
font color.

But in viewing on the excel sheet, it show "Red" in font color.

Thanks for your great help.


"Bob Phillips" bl...


"raymond chiu" wrote in message
...
Dear Helper,

First of all , thanks for your attention. I have one question.

Using VB, I need to check the background color of one cell in the Excel,
e.g. A1.
How can I know in the command, e.g. range("A1").????


Range("A1").Inter5ior.Colorindex

Moreover, if this cell has formating or some criteria, e.g. if the value

is
larger than one
number, then show it in yellow.
Would this effect or cannot give the value???


This is best achieved with Conditional Formatting. Check it out in help.

As We find that the cell show red font but .range("A1").font.color show

"0".

Don't understand. Range("A1") is a cell, so what do you mean by can cell
be
red but A1 font colour be "0"?





Bob Phillips

Excel Cell Criteria Effect
 
Okay, now I understand. That is because the conditional formatting colour is
different than the manual cell colour. Getting a CF colour is difficult, and
the usual way is to test whether the value of the cell meets the CF
criteria, thereby de-facto knowing what the colour is.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"raymond chiu" wrote in message
...
Dear Bob Phillips,

I mean the cell(e.g. A1) font color is red which is done by conditional
formating.
But when I use VB Program to see this cell font color (A1) , it shows "0"
which is same as black.

When I right click the cell A1 and choose "Format Cell", it show black in
font color.

But in viewing on the excel sheet, it show "Red" in font color.

Thanks for your great help.


"Bob Phillips"

bl...


"raymond chiu" wrote in message
...
Dear Helper,

First of all , thanks for your attention. I have one question.

Using VB, I need to check the background color of one cell in the

Excel,
e.g. A1.
How can I know in the command, e.g. range("A1").????


Range("A1").Inter5ior.Colorindex

Moreover, if this cell has formating or some criteria, e.g. if the

value
is
larger than one
number, then show it in yellow.
Would this effect or cannot give the value???


This is best achieved with Conditional Formatting. Check it out in help.

As We find that the cell show red font but .range("A1").font.color show

"0".

Don't understand. Range("A1") is a cell, so what do you mean by can cell
be
red but A1 font colour be "0"?








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

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