madvogue29
New Member
- Joined
- Aug 28, 2020
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Hi I have used this code on a sheet and it was working before but now it is giving me error 1004
I am getting error in the Selection.EntireRow.Delete
I can see the table being filtered and the rows selected but it just wont delete.
I hope you can help me
VBA Code:
Dim SelectedCell, Cell, rng As Range
Dim tbl As ListObject
Dim x As Long, i, y As Long
Dim hdr_Row As Long, last_row As Long, lastdata_row As Long
Worksheets("meetingTemplate").Activate
For Each tbl In ActiveSheet.ListObjects
Set rng = tbl.ListColumns(3).Range
For Each Cell In rng
If Not Cell.value = "COMPLETED" Then
Else
Application.DisplayAlerts = False
tbl.Range.AutoFilter 3, "COMPLETED"
Range(tbl.Name).Select
Selection.EntireRow.Delete
Application.DisplayAlerts = True
ActiveSheet.ShowAllData
End If
I am getting error in the Selection.EntireRow.Delete
I can see the table being filtered and the rows selected but it just wont delete.
I hope you can help me