ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Functions (https://www.excelbanter.com/excel-discussion-misc-queries/150868-functions.html)

Tim

Functions
 
Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!

excelent

Functions
 
Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!


Jim Thomlinson

Functions
 
Just a note. Changing a cells background colour does not force a calculation.
So when you first change the background the value will not show up. It will
show up as soon as any action is taken that cuases a calculation anywhere in
the application.
--
HTH...

Jim Thomlinson


"excelent" wrote:

Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!


Tim

Functions
 
Can you teach me how to do that? Please in detail... Many thanks in advance! :)

"excelent" wrote:

Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!


Tim

Functions
 
Hi
A good and a bad news!

I did it! :-)

But, the file became 4MB in size... :'(

"Tim" wrote:

Can you teach me how to do that? Please in detail... Many thanks in advance! :)

"excelent" wrote:

Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!


excelent

Functions
 
Brand new workbook with 3 tabs and a x in A1 : 13,5 KB
Same workbook with my Function : 19,0 KB

dono what goes wron in ur case :-)


"Tim" skrev:

Hi
A good and a bad news!

I did it! :-)

But, the file became 4MB in size... :'(

"Tim" wrote:

Can you teach me how to do that? Please in detail... Many thanks in advance! :)

"excelent" wrote:

Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!


Tim

Functions
 
Maybe because I copied it to an entire column...

"excelent" wrote:

Brand new workbook with 3 tabs and a x in A1 : 13,5 KB
Same workbook with my Function : 19,0 KB

dono what goes wron in ur case :-)


"Tim" skrev:

Hi
A good and a bad news!

I did it! :-)

But, the file became 4MB in size... :'(

"Tim" wrote:

Can you teach me how to do that? Please in detail... Many thanks in advance! :)

"excelent" wrote:

Possible with a VBA-Function like :

Function cValue(rng As Range, xValue)
Application.Volatile
If rng.Interior.ColorIndex = 3 Or rng.Font.ColorIndex = 3 Then cValue = xValue
End Function

in ur sheet type : =cValue(any-cell,any-value)


"Tim" skrev:

Hi,

Is it possible to do a formula like when cell background (or font color) is
red, a certain cell will return some value?

Thanks!



All times are GMT +1. The time now is 03:50 PM.

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