Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thx Ron,
I will try tomorrow or monday (as soon as I am working on this workbook again). And of course I let you know if it worked! H. "Ron de Bruin" schreef in bericht ... Try this macro for the range A1:A10000 A1 is a header Sub Delete_with_Autofilter() Dim rng As Range With ActiveSheet .Range("A1:A10000").AutoFilter Field:=1, Criteria1:="=" & DateSerial(2006, 4, 1), _ Operator:=xlOr, Criteria2:="<=" & DateSerial(2005, 12, 31) With ActiveSheet.AutoFilter.Range On Error Resume Next Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _ .SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Delete End With .AutoFilterMode = False End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "H." wrote in message ... yes... and the last day is 31 of march "Ron de Bruin" schreef in bericht ... Is Jan 1 the first day of quarter 1? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
resetting last cell | Excel Discussion (Misc queries) | |||
stop users from deleting rows | Excel Discussion (Misc queries) | |||
Deleting rows in a macro in Excel | Excel Discussion (Misc queries) | |||
Question about deleting rows from sorted linked worksheets | Excel Worksheet Functions | |||
Deleting rows containing common data | Excel Discussion (Misc queries) |