Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Set cell background based on date.

I saw a post similar to this earlier this week. I However i was unbale to get
it to work. My question is: I am working a caladar for work. I want a certian
set of cells to be highlighted, color is unimportant, based on todays date.
So if I open the workbook today, Oct. 28th will be highlighted. Tomorrow Oct
29th will be highlighted.

Thanks for your help,
Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Set cell background based on date.

sorry for the multiple postings. The first time i submitted it, i got an
error message.

Steve

"Steve" wrote:

I saw a post similar to this earlier this week. I However i was unbale to get
it to work. My question is: I am working a caladar for work. I want a certian
set of cells to be highlighted, color is unimportant, based on todays date.
So if I open the workbook today, Oct. 28th will be highlighted. Tomorrow Oct
29th will be highlighted.

Thanks for your help,
Steve

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Set cell background based on date.

Steve,

This will get you started. Drop this into the worksheet's module.

Option Explicit

Private Sub Worksheet_Activate()
Dim rngCell As Range

For Each rngCell In Me.Range(Me.Cells(1, 1),
Me.Cells.SpecialCells(xlCellTypeLastCell))
If rngCell.Value = Date Then
rngCell.Interior.Color = RGB(0, 0, 225)
ElseIf rngCell.Value = Date + 1 Then
rngCell.Interior.Color = RGB(255, 255, 0)
ElseIf IsDate(rngCell.Value) Then
rngCell.Interior.ColorIndex = xlColorIndexNone
End If
Next
End Sub


"Steve" wrote:

sorry for the multiple postings. The first time i submitted it, i got an
error message.

Steve

"Steve" wrote:

I saw a post similar to this earlier this week. I However i was unbale to get
it to work. My question is: I am working a caladar for work. I want a certian
set of cells to be highlighted, color is unimportant, based on todays date.
So if I open the workbook today, Oct. 28th will be highlighted. Tomorrow Oct
29th will be highlighted.

Thanks for your help,
Steve

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 background color of cell based on vlookup in cell Antney Excel Discussion (Misc queries) 1 October 19th 09 10:55 PM
Changing Cell Background Color based on data from another cell Speedy Excel Discussion (Misc queries) 2 March 16th 09 04:10 PM
Changing background color based on different cell djarcadian Excel Discussion (Misc queries) 3 August 10th 06 10:44 PM
Conditional cell background formatting, based on cell content nosivad Excel Discussion (Misc queries) 5 February 11th 06 11:12 PM
Setting cell background color based on value Erik[_5_] Excel Programming 3 February 25th 04 10:56 PM


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