close

Is it possible to use a formula to return a value of True if a cell you refer
to is coloured or not? What I want to do is: If Sheet1 A1 is shaded red,
then I want a cell in Sheet2 to return P for paid, if not stay blank?

Thanx

Becks

If you are willing to use a small UDF, then you can test for color. Enter
this UDF:

Function IsRed(r As Range) As Integer
IsRed = 0
If r.Interior.ColorIndex = 3 Then
IsRed = 1
End If
End Function

Then in A1 in Sheet2 enter:

=IF(IsRed(Sheet1!A1)=1,quot;Pquot;,quot;quot;)
--
Gary's Studentquot;Becksquot; wrote:

gt; Is it possible to use a formula to return a value of True if a cell you refer
gt; to is coloured or not? What I want to do is: If Sheet1 A1 is shaded red,
gt; then I want a cell in Sheet2 to return P for paid, if not stay blank?
gt;
gt; Thanx
gt;
gt; Becks

How do I enter the UDF? I've never used them before.

Thanks

quot;Gary''s Studentquot; wrote:

gt; If you are willing to use a small UDF, then you can test for color. Enter
gt; this UDF:
gt;
gt; Function IsRed(r As Range) As Integer
gt; IsRed = 0
gt; If r.Interior.ColorIndex = 3 Then
gt; IsRed = 1
gt; End If
gt; End Function
gt;
gt; Then in A1 in Sheet2 enter:
gt;
gt; =IF(IsRed(Sheet1!A1)=1,quot;Pquot;,quot;quot;)
gt; --
gt; Gary's Student
gt;
gt;
gt; quot;Becksquot; wrote:
gt;
gt; gt; Is it possible to use a formula to return a value of True if a cell you refer
gt; gt; to is coloured or not? What I want to do is: If Sheet1 A1 is shaded red,
gt; gt; then I want a cell in Sheet2 to return P for paid, if not stay blank?
gt; gt;
gt; gt; Thanx
gt; gt;
gt; gt; Becks

I have entered the UDF, and it works initially. But if the colour is cleared
or added later the formula doesn't update?

quot;Becksquot; wrote:

gt; How do I enter the UDF? I've never used them before.
gt;
gt; Thanks
gt;
gt; quot;Gary''s Studentquot; wrote:
gt;
gt; gt; If you are willing to use a small UDF, then you can test for color. Enter
gt; gt; this UDF:
gt; gt;
gt; gt; Function IsRed(r As Range) As Integer
gt; gt; IsRed = 0
gt; gt; If r.Interior.ColorIndex = 3 Then
gt; gt; IsRed = 1
gt; gt; End If
gt; gt; End Function
gt; gt;
gt; gt; Then in A1 in Sheet2 enter:
gt; gt;
gt; gt; =IF(IsRed(Sheet1!A1)=1,quot;Pquot;,quot;quot;)
gt; gt; --
gt; gt; Gary's Student
gt; gt;
gt; gt;
gt; gt; quot;Becksquot; wrote:
gt; gt;
gt; gt; gt; Is it possible to use a formula to return a value of True if a cell you refer
gt; gt; gt; to is coloured or not? What I want to do is: If Sheet1 A1 is shaded red,
gt; gt; gt; then I want a cell in Sheet2 to return P for paid, if not stay blank?
gt; gt; gt;
gt; gt; gt; Thanx
gt; gt; gt;
gt; gt; gt; Becks

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()