PC Review


Reply
Thread Tools Rate Thread

conditional coloring the current cell

 
 
ciprian
Guest
Posts: n/a
 
      23rd Feb 2009
Hi,

I try to color the cell in witch i run the function based on the results
from others cells below it.

the problem: on A1 i have the function =color_me( A2:A10 )
in A2 throw A10 i have different texts wit different color, i want to color
A1 with the most "important" color from the range (green, white, blue, red) i
chose based on different critera.
I manage to get the color, but i cant "write" the color to A1. Tried with
..Interior.ColorIndex but nothing

Anyone can help?

Thanks


 
Reply With Quote
 
 
 
 
Nigel
Guest
Posts: n/a
 
      23rd Feb 2009
You need to supply the function code, and the criteria you refer to....also
what version of xl are you using, color management is far easier in xl2007

--

Regards,
Nigel
(E-Mail Removed)



"ciprian" <(E-Mail Removed)> wrote in message
news:26ABC608-C43A-425D-9C1C-(E-Mail Removed)...
> Hi,
>
> I try to color the cell in witch i run the function based on the results
> from others cells below it.
>
> the problem: on A1 i have the function =color_me( A2:A10 )
> in A2 throw A10 i have different texts wit different color, i want to
> color
> A1 with the most "important" color from the range (green, white, blue,
> red) i
> chose based on different critera.
> I manage to get the color, but i cant "write" the color to A1. Tried with
> .Interior.ColorIndex but nothing
>
> Anyone can help?
>
> Thanks
>
>


 
Reply With Quote
 
ciprian
Guest
Posts: n/a
 
      23rd Feb 2009
yes sorry, here is the code, and i use office2003, in this version i modify
the cell above the cell the function in running into.

Do exists a pointer to the running cell? something like ActiveCell?

Public Function Free(rRng As Range) As String

Dim FreeOuiNon As Boolean
Dim color As Long
Dim RetColor As Long


FreeOuiNon = True
RetColor = 9999
color = -1

topCol = rRng.Column
topRow = rRng.Row - 2


For Each c In rRng.Cells
If (IsEmpty(c.Value) And FreeOuiNon) Then
FreeOuiNon = True
Else
FreeOuiNon = False
color = c.Interior.ColorIndex
End If

' red = 3, green = 4, white = -4142
If (color > 0) And (color < RetColor) Then RetColor = color
Next c


If FreeOuiNon = True Then
Free = RetColor
Else
Cells(topRow, topCol).Interior.ColorIndex = RetColor
Cells(topRow, topCol).Interior.Pattern = xlSolid

Free = RetColor
End If

End Function


"Nigel" wrote:

> You need to supply the function code, and the criteria you refer to....also
> what version of xl are you using, color management is far easier in xl2007
>
> --
>
> Regards,
> Nigel
> (E-Mail Removed)
>
>
>
> "ciprian" <(E-Mail Removed)> wrote in message
> news:26ABC608-C43A-425D-9C1C-(E-Mail Removed)...
> > Hi,
> >
> > I try to color the cell in witch i run the function based on the results
> > from others cells below it.
> >
> > the problem: on A1 i have the function =color_me( A2:A10 )
> > in A2 throw A10 i have different texts wit different color, i want to
> > color
> > A1 with the most "important" color from the range (green, white, blue,
> > red) i
> > chose based on different critera.
> > I manage to get the color, but i cant "write" the color to A1. Tried with
> > .Interior.ColorIndex but nothing
> >
> > Anyone can help?
> >
> > Thanks
> >
> >

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Conditional format, using current and other cell, searching blanks Jacob Skaria Microsoft Excel Misc 2 1st May 2009 11:57 AM
conditional cell coloring phrodude Microsoft Excel Worksheet Functions 5 28th Jul 2006 12:15 AM
conditional cell coloring phrodude Microsoft Excel Misc 5 27th Jul 2006 04:26 PM
Conditional coloring of Excel cells, based on adjacent cell values? Greg Stuart Microsoft Excel Worksheet Functions 0 10th Mar 2006 10:14 PM
Conditional cell coloring =?Utf-8?B?V2VsbGll?= Microsoft Excel Programming 3 9th Apr 2005 06:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 AM.