Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, i have code below that filters field 10 and then deletes the
filterd rows that are showing; this works great, but i have to filter another field afterwards and have tried to use the same code, but it then deletes everything ?? Can somebody tell me why.. Public Sub FilterCreatedBy() Dim WB As Workbook Dim SH As Worksheet Dim Rng As Range Set WB = ActiveWorkbook Set SH = ActiveSheet Rows("1:1").Select Selection.AutoFilter Selection.AutoFilter Field:=10, Criteria1:="=*za-t-m-**", Operator:=xlAnd On Error Resume Next Set Rng = SH.AutoFilter.Range Set Rng = Rng.Offset(1).Resize(Rng.Rows.Count - 1) Set Rng = Rng.SpecialCells(xlVisible) On Error GoTo 0 If Not Rng Is Nothing Then Rng.EntireRow.Delete End If Selection.AutoFilter Field:=10 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Rows Filtered within Auto Filter | Excel Programming | |||
filter and delete rows based on two criteria | Excel Programming | |||
Delete rows in filter view | Excel Worksheet Functions | |||
macro to delete duplicate rows using Filter | Excel Programming | |||
Auto Filter Delete Rows by Criteria Doesn't Work Range To Complicated | Excel Programming |