Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Can you use formulas to manipulate the fill color of a cell?

Assume your goal is 80 and the cell is A1.

Private Sub Worksheet_Change(By Val Target As Range)
If Cells(1, 1) <= 79 And Cells(1, 1) < "" Then
Cells(1, 1).Interior.ColorIndex = 3
Cells(1, 1).Font.ColorIndex = 2
ElseIf Cells(1, 1) = 80 And Cells(1, 1) < "" Then
Cells(1, 1).Interior.ColorIndex = 10
Cells(1, 1).Font.ColorIndex = 1
End If
End Sub

This would go in your Worksheet code module. Right click the sheet tab,
click view code, copy above code and paste into module.

"kAustin79" wrote:

I have Excel 2003. I want to change the fill color of a cell in relation to
it's own contents (ex. I will set a number as a goal for myself. There will
be a cell that will calculate my progress. While I am still under my goal
number, the fill color of the cell will be red and the text white - Once I
exceed my goal, the fill color will turn green and the text will be black).

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
How do I fill one cell color with text html/rgb color from another thewris Excel Discussion (Misc queries) 2 January 22nd 09 12:24 AM
Match TextBox Back Color to Cell Fill Color AMY Z. Excel Programming 4 October 12th 06 06:07 PM
Fill in Color within formulas tom Excel Worksheet Functions 3 August 29th 06 03:57 AM
manipulate color with code Ningster[_2_] Excel Programming 3 July 8th 06 12:24 AM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM


All times are GMT +1. The time now is 04:45 PM.

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

About Us

"It's about Microsoft Excel"