View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Simple Clear Contents

Dim rng as Range, cell as Range
set rng = Range(Cells(1,4),Cells(rows.count,4).End(xlup))
for each cell in rng
if isdate(cell) then
if cdate(cell.value) DateSerial(2005,1,1) then
cell.EntireRow.ClearContents
end if
end if
Next

--
Regards,
Tom Ogilvy


"Steph" wrote in message
...
This seems so simple, but I can't figure it out.

In a large spreadsheet, I would like to ClearContents of the entire row IF
the contents in column D of each respective row is greater than the date
1/1/2005.

So in row 1, if D1 is 1/1/2005, clear
In row 2, if D2 is 1/1/2005, clear......

Thanks!