Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default 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
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
Is there a formlula to replace cell shade color with another color Newsgal Excel Worksheet Functions 4 February 9th 10 09:21 AM
shade one cell that will shade multiple cells Walt Excel Discussion (Misc queries) 1 November 17th 09 03:46 PM
Shading cells - how to pick a slight/different shade of a color Mark New Users to Excel 4 January 1st 09 09:53 PM
How can I count the number of cells with a particular color/shade Lynn Excel Worksheet Functions 3 June 5th 08 08:51 AM
How do U Color shade Locked and FormulaHidden Cells Kieranz Excel Programming 3 May 23rd 06 12:40 PM


All times are GMT +1. The time now is 09:55 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"