Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
delete entirerow if date more than 12months old
I want to delete the entire row if the date in column B (yyyymm format e.g.
200605 for may 2006) is more than 12 months old. how do I write the if statement in the macro? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
delete entirerow if date more than 12months old
http://cjoint.com/?fzqFMePa5S
Sub test() coldep = 2 For i = 2 To Cells(65000, coldep).End(xlUp).Row If Cells(i, coldep) < DateSerial(Year(Date), Month(Date) - 12, Day(Date)) Then Rows(i).Hidden = True ' replace Hidden by delete End If Next i End Sub Cordialy JB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I WANT TO DELETE A WIDE OF DATE IN A EXCEL FILE | Excel Discussion (Misc queries) | |||
Another Date issue. | Excel Worksheet Functions | |||
Date Math Problem | Excel Worksheet Functions | |||
date and time | New Users to Excel | |||
Using formulas to determine date in one cell based on date in anot | Excel Worksheet Functions |