Hi, feel stupid as I have a feeling this is a simply question and I am doing something silly. I have the following code to filter a column between date range then delete all visible rows, then take off filter to display the remaining rows outside the date range. I use this code on another workbook with no problems as all. However on this workbook the code does the trick in deleting the range but also deletes the header!! though I am using the 'offset' function to avoid row 1. Not sure why and I have tried lots of work arounds with no luck. Any ideas?
many thanks in advanceCode:With GTNreport.Sheets("PRG CFS Receipts") 'DELETE LINES OUTSIDE OF WEEK WE NEED With Range(("J1"), Range("J1000")).End(xlUp) .AutoFilter 10, Criteria1:="<" & GetDateRangeFrom, Operator:=xlOr, Criteria2:=">" & GetDateRangeTo On Error Resume Next .Offset(1).SpecialCells(12).EntireRow.Delete .Range("A1").Select Selection.AutoFilter End With![]()




Reply With Quote

Bookmarks