Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a range of cells shade a certain color
I want a cell to be shaded a certain color based on today's date versuses the
date in the field upon opening the worksheet daily. For example if the date in the field in 02 Apr 2008 and today is 14 Apr 2008 the cell should automatically change to let's say red when the workbook opens. At the same time if the date is 14 Apr 2008 and the date in the cell is within 30 days it should be shaded yellow etc... Can you help? -- One |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a range of cells shade a certain color
Try this
Sub WorkSheet_Open() 'Change ActiveCell to what ever you need it to be i.e. ("A1") If ActiveCell.Value Date Then ActiveCell.Interior.ColorIndex = 3 End If End Sub "akeshka" wrote: I want a cell to be shaded a certain color based on today's date versuses the date in the field upon opening the worksheet daily. For example if the date in the field in 02 Apr 2008 and today is 14 Apr 2008 the cell should automatically change to let's say red when the workbook opens. At the same time if the date is 14 Apr 2008 and the date in the cell is within 30 days it should be shaded yellow etc... Can you help? -- One |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
have a range of cells shade a certain color
Or this ...
Private Sub Worksheet_Activate() Dim Rng As Range Dim i As Variant Set Rng = Range("A1:A36") ' <------Change to Suit your range i = ActiveCell.Value For Each i In Rng ActiveCell.Offset(1, 0).Select If i = Date Then ActiveCell.Interior.ColorIndex = 3 ElseIf i < Date Then ActiveCell.Interior.ColorIndex = 6 End If Next i End Sub "akeshka" wrote: I want a cell to be shaded a certain color based on today's date versuses the date in the field upon opening the worksheet daily. For example if the date in the field in 02 Apr 2008 and today is 14 Apr 2008 the cell should automatically change to let's say red when the workbook opens. At the same time if the date is 14 Apr 2008 and the date in the cell is within 30 days it should be shaded yellow etc... Can you help? -- One |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a formlula to replace cell shade color with another color | Excel Worksheet Functions | |||
shade one cell that will shade multiple cells | Excel Discussion (Misc queries) | |||
Shading cells - how to pick a slight/different shade of a color | New Users to Excel | |||
How can I count the number of cells with a particular color/shade | Excel Worksheet Functions | |||
How do U Color shade Locked and FormulaHidden Cells | Excel Programming |