Really not sure about some of your business rules, but here's my best guess, and a different way to consider
Instead of filtering, I added a "Report" helper column to sieve the raw data and a pivot table to report the results
Like I said, really not sure if I got the rules correct, but IMHO the sieve approach would be easier
Option Explicit
Const cATA As Long = 1
Const cETA As Long = 2
Const cContainerID As Long = 5
Const cPlanned As Long = 13
Const cAdj As Long = 14
Const cCity As Long = 15
Const cReport As Long = 21
Sub ReportData()
Dim iRow As Long
Dim rData As Range
Set rData = ActiveSheet.Cells(1, 1).CurrentRegion
With rData
For iRow = 2 To .Rows.Count
'1. from containerID - filter everything that does not contain "part"
If InStr(LCase(.Cells(iRow, cContainerID).Value), "part") > 0 Then
.Cells(iRow, cReport).Value = "No#1"
'2. In AdjPlannedDelivery - untick blanks
ElseIf Len(.Cells(iRow, cAdj).Value) = 0 Then
.Cells(iRow, cReport).Value = "No#2"
'2. In AdjPlannedDelivery - untick everything up to today (included)
ElseIf .Cells(iRow, cAdj).Value = Int(Now) Then
.Cells(iRow, cReport).Value = "No#3"
'3. in PlannedDelivery - delete all visible cells - not needed
'4. in AdjPlannedDelivery - unfilter - not needed
'5. Select location from deliverydepotcity - not needed
'6. in planned delivery - untick all up till today (included)
ElseIf .Cells(iRow, cPlanned).Value < Int(Now) Then
.Cells(iRow, cReport).Value = "No#4"
'7. count number of cells with data in ATA and note it down to the sheet we created in the beginning - in pivot table
'8. count number of cells with data in ETA and note it down to the sheet we created in the beginning - in pivot table
'9. In ATA - untick blanks
ElseIf Len(.Cells(iRow, cATA).Value) > 0 Then
.Cells(iRow, cReport).Value = "Yes4"
'9. In ATA - untick past 4 days
ElseIf .Cells(iRow, cATA).Value < Int(Now) - 4 Then
.Cells(iRow, cReport).Value = "Yes4"
Else
.Cells(iRow, cReport).Value = "Yes"
End If
'10. count number of cells with data in the adjusted ATA and note it down to the sheet we created in the beginning - in pivot table
Next iRow
End With
ActiveSheet.Cells(1, 1).CurrentRegion.Name = "AllData"
End Sub
Edits
1. You could use VBA arrays, but for something this small, I'd just stick to worksheets
2. Instead of the PT, it might be possible to use some clever worksheet function on the reporting sheet after the raw data has been processes. I went with a PT since it was easier (for me)