Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
lee lee is offline
external usenet poster
 
Posts: 184
Default how can i change colour of a cell

on excel, how can you change the colour of a cell by putting a value in
another cell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default how can i change colour of a cell

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:

=A110

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., A110), 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
wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default how can i change colour of a cell

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" wrote in message
...
on excel, how can you change the colour of a cell by putting a value in
another cell


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
Change cell colour on formula result change, no conditional format roster_jon Excel Programming 0 December 2nd 08 12:11 PM
Change cell colour to red John[_22_] Excel Programming 7 November 25th 08 03:46 PM
if cell colour is then change cell colour in range tiger Excel Programming 2 May 30th 07 05:32 AM
change a cell background colour to my own RGB colour requirements Stephen Doughty Excel Discussion (Misc queries) 4 June 16th 06 01:08 PM
COLOUR CHANGE IS A CELL Mav Excel Discussion (Misc queries) 1 April 23rd 05 11:22 AM


All times are GMT +1. The time now is 08:11 AM.

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"