Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
Please refer to the code included below.
Why am I getting an #n/a value (in $B$4) with the part of the procedure highlighted in red. I am desiring to have the # of rows deleted by this code displayed.
Jenn
Rich (BB code):
With Worksheets("CLASS_Data")
With .Range("A1:J8600")
.AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Worksheets("Criteria").Range("D1:G2"), _
Unique:=False
On Error Resume Next
Set rngToDelete = .Offset(1).Resize(.Rows.Count - 1, 1).SpecialCells(xlCellTypeVisible)
Worksheets("Criteria").Range("$B$4").Value = rngToDelete
On Error GoTo 0
End With
If .FilterMode Then .ShowAllData
End With
If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete
Why am I getting an #n/a value (in $B$4) with the part of the procedure highlighted in red. I am desiring to have the # of rows deleted by this code displayed.
Jenn