Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Some Help Please anyone

I was wondering if you could help me with a VBA problem?

I have a range of cells with a date format. I want to check each cell and
check its date against today's date.
So. I have the first cell selected. I then run a do loop until I reach a
"nil" cell.

On each cell select, I want it to check (a) the cell value (b) is it grater
than Now()

If it is = to Now() then I want the cell to change VBred.

Thanks
WiReLad


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Some Help Please anyone

Something like:

Sub cellcheck()
If ActiveCell.Value = Date Then ActiveCell.Interior.ColorIndex = 3 ' (you
can do more formatting here if you want)
End Sub

Joe90

"WiReLaD" wrote in message
...
I was wondering if you could help me with a VBA problem?

I have a range of cells with a date format. I want to check each cell and
check its date against today's date.
So. I have the first cell selected. I then run a do loop until I reach a
"nil" cell.

On each cell select, I want it to check (a) the cell value (b) is it

grater
than Now()

If it is = to Now() then I want the cell to change VBred.

Thanks
WiReLad




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Some Help Please anyone

try this. Modify to suit.

Sub colorem()
x = Cells(65536, 1).End(xlUp).Row
For Each c In Range(Cells(1, 1), Cells(x, 1))
If c Date Then c.Font.ColorIndex = 3
Next c
End Sub

"WiReLaD" wrote in message
...
I was wondering if you could help me with a VBA problem?

I have a range of cells with a date format. I want to check each cell and
check its date against today's date.
So. I have the first cell selected. I then run a do loop until I reach a
"nil" cell.

On each cell select, I want it to check (a) the cell value (b) is it

grater
than Now()

If it is = to Now() then I want the cell to change VBred.

Thanks
WiReLad




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Some Help Please anyone

On Sat, 4 Oct 2003 23:14:53 +0100, "WiReLaD" wrote:

I was wondering if you could help me with a VBA problem?

I have a range of cells with a date format. I want to check each cell and
check its date against today's date.
So. I have the first cell selected. I then run a do loop until I reach a
"nil" cell.

On each cell select, I want it to check (a) the cell value (b) is it grater
than Now()

If it is = to Now() then I want the cell to change VBred.

Thanks
WiReLad


Here's another approach that saves looping through all the cells, so should be
quicker *IF* you are not otherwise using conditional formatting and *IF* you
want the color to change if you change the contents:


With Range("A1:A100")
.FormatConditions.Delete
.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual _
, Formula1:="=NOW()"
.FormatConditions(1).Interior.Color = vbRed
End With


--ron
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



All times are GMT +1. The time now is 08:38 PM.

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"