ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Some Help Please anyone (https://www.excelbanter.com/excel-programming/278785-some-help-please-anyone.html)

WiReLaD

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



Joe 90[_2_]

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





Don Guillett[_4_]

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





Ron Rosenfeld

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


All times are GMT +1. The time now is 04:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com