Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete data if not within date range
I have a cumbersome spread sheet that contains over 20,000 rows that
includes a date column. Using the current date as a reference point, I would like to delete all rows 14 days prior to today and 14 days after today. Any help would be appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete data if not within date range
assuming you mean farther away from today's date than 14 days and not 14
days exactly, set lastrow = cells(rows.count,"C").End(xlup) for lastrow to 2 step -1 if abs(Date-Int(cells(i,"C"))) 14 then rows(i).Delete end if Next adjust the "" to "=" if you want to delete dates exactly 14 days away -- Regards, Tom Ogilvy "Denise" wrote in message oups.com... I have a cumbersome spread sheet that contains over 20,000 rows that includes a date column. Using the current date as a reference point, I would like to delete all rows 14 days prior to today and 14 days after today. Any help would be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to delete blank rows in a data range | Excel Discussion (Misc queries) | |||
delete row if no data, non-contiguous range problem | Excel Programming | |||
delete row if no data, non-contiguous range problem | Excel Programming | |||
Delete Date data macro | Excel Programming | |||
Excel VBA - Delete rows within a date range | Excel Programming |