ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to return the color of a cell (https://www.excelbanter.com/excel-programming/405506-how-return-color-cell.html)

[email protected]

How to return the color of a cell
 
Dear Sir

how to return the color code of a cell using excel formulas "not VBA
macros".i mean
if i have two cells and i need to know the color code of the two cells
(light yellow or yellow or red or even the color index of them)

i will appreciate if you reply to me ASAP

thanks & Best regrads

Nigel[_2_]

How to return the color of a cell
 
Not possible using Formula. VBA easy, you could use a VBA function?

The closest is if the color is being set by a conditional format, then
indirectly you could get the color knowing the condition, but I suspect that
is not what you want.



--

Regards,
Nigel




wrote in message
...
Dear Sir

how to return the color code of a cell using excel formulas "not VBA
macros".i mean
if i have two cells and i need to know the color code of the two cells
(light yellow or yellow or red or even the color index of them)

i will appreciate if you reply to me ASAP

thanks & Best regrads



Peter T

How to return the color of a cell
 
As Nigel says there are no built in formulas to return cell formats, though
you could use an old XL4macro in a Named formula

Assuming you will always want to refer to a cell one to the left in same
row, start by selecting cell B1

Define this name Ctrl-F3
Name: ForeColor
RefersTo: =GET.CELL(38,A1)

In any cell one to the right of whose interior colorindex you want to return
enter
=ForeColor

Will return 1-56 or 0 if no fill.

It will not automatically update if you reformat, press Ctrl-Alt-F9 to
recalc.

Regards,
Peter T


wrote in message
...
Dear Sir

how to return the color code of a cell using excel formulas "not VBA
macros".i mean
if i have two cells and i need to know the color code of the two cells
(light yellow or yellow or red or even the color index of them)

i will appreciate if you reply to me ASAP

thanks & Best regrads




Peter T

How to return the color of a cell
 
As Nigel says there are no built in formulas to return cell formats, though
you could use an old XL4macro in a Named formula

Assuming you will always want to refer to a cell one to the left in same
row, start by selecting cell B1

Define this name Ctrl-F3
Name: ForeColor
RefersTo: =GET.CELL(38,A1)

In any cell one to the right of whose interior colorindex you want to return
enter
=ForeColor

Will return 1-56 or 0 if no fill.

It will not automatically update if you reformat, press Ctrl-Alt-F9 to
recalc.

Regards,
Peter T


wrote in message
...
Dear Sir

how to return the color code of a cell using excel formulas "not VBA
macros".i mean
if i have two cells and i need to know the color code of the two cells
(light yellow or yellow or red or even the color index of them)

i will appreciate if you reply to me ASAP

thanks & Best regrads





All times are GMT +1. The time now is 11:48 PM.

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