Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Simple Clear Contents

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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
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!




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
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
Clear Contents Of Cells Where Value = 0 carl Excel Worksheet Functions 3 July 6th 07 06:02 PM
Clear clipboard contents Cordobes Excel Discussion (Misc queries) 4 November 22nd 05 02:41 AM
Clear contents if x is not in the row Mighvik Excel Programming 1 October 5th 04 08:14 PM


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