Seamus2626
asked on
Filter and delete
I have the below code to delete selections, if there is no selections there, i get the VBA error "object required"
How can i ignore this and move on if there is nothing to delete
Thanks
Seamus
How can i ignore this and move on if there is nothing to delete
Thanks
Seamus
Sheets("Sophis").Select
With ActiveSheet
If .FilterMode Then .ShowAllData
End With
With ActiveSheet
ActiveSheet.Cells.EntireColumn.Hidden = False
.AutoFilterMode = False
.Range("A5").AutoFilter Field:=19, Criteria1:="Matched"
With .AutoFilter.Range
On Error Resume Next
Set rData = .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rData Is Nothing Then
rData.EntireRow.Delete
End If
End With
.AutoFilterMode = False
End With
ThisWorkbook.Sheets("Sophis").Range("A1").CurrentRegion.Copy _
Workbooks("NewUnmatched.xls").Sheets("Sophis Aspa Matches").Range("A" & Rows.Count).End(xlUp)(2)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER