Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|