Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color Cells via VBA
I'm trying to set the background color (highlight) cells
in my spreadsheet based on the value of a cell. I haven't been able to find a way to access this programmatically, and I don't want to do it by hand every time the value changes. Any clues? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color Cells via VBA
If you have 3 or fewer conditions try formatconditional format. If not come
back for code. -- Don Guillett SalesAid Software "Mike Eckardt" wrote in message ... I'm trying to set the background color (highlight) cells in my spreadsheet based on the value of a cell. I haven't been able to find a way to access this programmatically, and I don't want to do it by hand every time the value changes. Any clues? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color Cells via VBA
this could be one example
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = 1 Then Target.Cells.Interior.ColorIndex = 1 ElseIf Target.Value = 2 Then Target.Cells.Interior.ColorIndex = 4 Else Target.Cells.Interior.ColorIndex = 3 End If End Sub note: the code has to be placed in the sheet module Alternatively you could also use conditional formatting - Mangesh --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to color automatically color code sums in cells | Charts and Charting in Excel | |||
How do I apply color in cells ..color now shown only in print prev | Excel Worksheet Functions | |||
Excel 2003 will not display color fonts or color fill cells | Excel Worksheet Functions | |||
Color Formatted Cells not showing color | Excel Worksheet Functions | |||
My excel 2003 wont let me fill cells with color or color the tabs. | New Users to Excel |