Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nirmal,
using the intersect with 1 row offset works for me: Sub FilterDel() Dim rDel As Range With Range("A1") .AutoFilter .AutoFilter 1, "<A000000000" With .Worksheet.AutoFilter.Range On Error Resume Next Set rDel = Intersect(.Cells.Offset(1), _ .SpecialCells(xlCellTypeVisible)) On Error GoTo 0 If Not rDel Is Nothing Then rDel.EntireRow.Delete End With .AutoFilter .Select End With End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Nirmal Singh wrote : I am using the following code to filter a list and delete unwanted records. The list has headers on the top row. These are also getting deleted. How can I do this without deleting the header row? Range("A1").Select Selection.AutoFilter Selection.AutoFilter Field:=1, Criteria1:="<A000000000", Operator:= rator:=xlAnd Selection.SpecialCells(xlCellTypeVisible).Delete Selection.AutoFilter Range("A1").Select Nirmal Singh |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rogue rows appear in autofiltered sort | Excel Discussion (Misc queries) | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Copy Autofiltered rows to another workbook using macro | Excel Discussion (Misc queries) | |||
How to plot only visible autofiltered rows in a data list | Charts and Charting in Excel | |||
Count Autofiltered Rows? | Excel Programming |