PC Review


Reply
Thread Tools Rate Thread

how can i change colour of a cell

 
 
lee
Guest
Posts: n/a
 
      20th May 2009
on excel, how can you change the colour of a cell by putting a value in
another cell
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      20th May 2009
Conditional Formatting on the Format menu can do this. First, select
the cell whose color should change. Then, open the Conditional
Formatting dialog from the Format menu. There, change "Cell Value Is"
to "Formula Is" and enter something like the following in the formula
box:

=A1>10

Change that formula to return TRUE or FALSE, indicating whether the
format should be applied. Then click the Format button and choose the
Pattern tab. Select the color to fill the cell. Click OK until you're
done. If the formula is TRUE (e.g., A1>10), the format you selected
will be applied to the cell. If the formula is FALSE, no format (other
than the cell's default format) will be applied to the cell.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Wed, 20 May 2009 13:56:01 -0700, lee
<(E-Mail Removed)> wrote:

>on excel, how can you change the colour of a cell by putting a value in
>another cell

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      21st May 2009
put this code in the sheet's code page (right click the tab & click View
Code)


Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
' cell D4 triggers a colr change in E4
If Target.Address = "$D$4" Then
If IsNumeric(Target.Value) Then
Select Case Target.Value
Case 1 To 56
Range("E4").Interior.ColorIndex = Target.Value
Case Else
End Select
End If
End If
End Sub

to see all available colors, put this code into a standard module

Option Explicit
Sub ListColors()
Dim i As Long
On Error GoTo Quit
i = 1
Do
Cells(i, 1) = i
Cells(i, 2).Interior.ColorIndex = i
i = i + 1
Loop
Quit:
End Sub

"lee" <(E-Mail Removed)> wrote in message
news:3861EDAF-C5DE-4290-9765-(E-Mail Removed)...
> on excel, how can you change the colour of a cell by putting a value in
> another cell


 
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
Change cell colour on formula result change, no conditional format roster_jon Microsoft Excel Programming 0 2nd Dec 2008 12:11 PM
if cell colour is then change cell colour in range =?Utf-8?B?dGlnZXI=?= Microsoft Excel Programming 2 30th May 2007 05:32 AM
change current cell colour based on the value of adjacent cell on other worksheet Rits Microsoft Excel Programming 2 23rd Nov 2006 11:57 AM
change a cell background colour to my own RGB colour requirements =?Utf-8?B?U3RlcGhlbiBEb3VnaHR5?= Microsoft Excel Misc 4 16th Jun 2006 01:08 PM
How can i change cell colour depending on month of date in cell? andy75 Microsoft Excel Misc 2 6th Jan 2006 07:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 PM.