Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default =ColorCell(Color)

I want to create a function that Colors the Active Cell based on a certain
criteria.
Example:
A1: 10
B1: =ColorCell(A1)

I want to use it instead of conditional formatting since I want the
flexibility - so I can use all 56 colors. Also I want =ColorCell(A1) to
return "" (=blank)

Is this possible?
Ola
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default =ColorCell(Color)

You want to put a formula in B1 that will change the color of Cell A1 or
event change the color of cell B1? Unfortunately, that isn't a capability
that formulas are allowed to posses. Perhaps you want to use the calculate
event to monitor the value and change the color.

Also, how does activecell relate to A1?

--
Regards,
Tom Ogilvy



"Ola" wrote in message
...
I want to create a function that Colors the Active Cell based on a certain
criteria.
Example:
A1: 10
B1: =ColorCell(A1)

I want to use it instead of conditional formatting since I want the
flexibility - so I can use all 56 colors. Also I want =ColorCell(A1) to
return "" (=blank)

Is this possible?
Ola



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default =ColorCell(Color)

Ola,

If you want more than 3 conditions, see
http://www.xldynamic.com/source/xld.....Download.html

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ola" wrote in message
...
I want to create a function that Colors the Active Cell based on a certain
criteria.
Example:
A1: 10
B1: =ColorCell(A1)

I want to use it instead of conditional formatting since I want the
flexibility - so I can use all 56 colors. Also I want =ColorCell(A1) to
return "" (=blank)

Is this possible?
Ola



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default =ColorCell(Color)

So it is impossible. Not often you hear that.

Tom - I wanted it to work exactly as Conditional Formatting (on the active
cell), apart from controlling the ColorIndex from A1...or any other cell.
(Example: =ColorCell(C43)).
Bob - It's a good add-in, but since I'm going to send this spreadsheet to a
number of people around Europe, I can't ask them to download and install an
add-in. That's why a small VBA code had been perfect.

Thanks anyway, I appreciate the effort.
Ola

FWIW, good article: http://www.developerfusion.com/show/35/7/
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default =ColorCell(Color)

No it is not impossible, the add-in shows that, but you need VBA. You can
either use the add-in out of the box, or craft your own code.

As a starter
Private Sub Worksheet_Change(ByVal Target As Range)


On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A1:H10")) Is Nothing Then
With Target
Select Case UCase(.Value)
Case 10: .Interior.ColorIndex = 5
Case 11: .Interior.ColorIndex = 46
Case 12: .Interior.ColorIndex = 7
Case 13: .Interior.ColorIndex = 3
'etc.
End Select

.value = ""

End With
End If


ws_exit:
Application.EnableEvents = True
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ola" wrote in message
...
So it is impossible. Not often you hear that.

Tom - I wanted it to work exactly as Conditional Formatting (on the active
cell), apart from controlling the ColorIndex from A1...or any other cell.
(Example: =ColorCell(C43)).
Bob - It's a good add-in, but since I'm going to send this spreadsheet to

a
number of people around Europe, I can't ask them to download and install

an
add-in. That's why a small VBA code had been perfect.

Thanks anyway, I appreciate the effort.
Ola

FWIW, good article: http://www.developerfusion.com/show/35/7/



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
Can't format cell color/text color in Office Excel 2003 in fil Tony S Excel Discussion (Misc queries) 1 December 21st 07 01:41 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. trizog New Users to Excel 2 February 22nd 05 06:43 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM


All times are GMT +1. The time now is 07:53 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"