Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default coloring todays date

I have rows of data containing date info in dd mm yyyy format on column J in
various sheets.
What VB code should I use in the workbook or module code page so that the
rows will be highlighted (or yellow colored) containing today's date on
column E?
TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default coloring todays date

Hi J_J,

Had a similar problem ... adjust the following to your needs :
Private Sub Worksheet_Change(ByVal Target As Range)

Dim Cell As Range
Set Target = Range("J1:J200")
For Each Cell In Target
If Cell.Value = Now() Then
Cell.Offset(0, -8).Range("A1:L1").Interior.ColorIndex = 6
End If
If Cell.Value < Now() Then
Cell.Offset(0, -8).Range("A1:L1").Interior.ColorIndex =
xlNone
End If
Next Cell
End Sub

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default coloring todays date

Use conditional formating. It's instantaneous and it requires no vba code.

Glen
"J_J" wrote in message
...
I have rows of data containing date info in dd mm yyyy format on column J
in various sheets.
What VB code should I use in the workbook or module code page so that the
rows will be highlighted (or yellow colored) containing today's date on
column E?
TIA





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 formula that will subtract todays date from a hire date Heather Excel Worksheet Functions 5 April 25th 23 07:44 PM
Making a date go red, if date passes todays date. Jamie Excel Worksheet Functions 2 September 9th 08 02:14 PM
Exel increment date problem wrt todays date. [email protected] Excel Worksheet Functions 1 November 11th 07 06:58 PM
Create a button that will date stamp todays date in a cell Tom Meacham Excel Discussion (Misc queries) 3 January 11th 06 01:08 AM
When I open my past invoice it keeps changing date to todays date Stop date changing to todays in Excel Excel Worksheet Functions 2 October 7th 05 04:54 PM


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