Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default conditional coloring the current cell

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default conditional coloring the current cell

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




"ciprian" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional cell coloring phrodude Excel Worksheet Functions 5 July 28th 06 12:15 AM
conditional cell coloring phrodude Excel Discussion (Misc queries) 5 July 27th 06 04:26 PM
Conditional coloring of Excel cells, based on adjacent cell values? Greg Stuart Excel Worksheet Functions 0 March 10th 06 10:14 PM
conditional coloring Krishna Mohan Excel Worksheet Functions 2 April 19th 05 02:02 PM
Conditional cell coloring Wellie Excel Programming 3 April 9th 05 06:14 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"