I have worksheet (protected) with 5 tables, i want to copy the data from all the tables without blank row's to another worksheet. The code for copying works but the code for removing blank rows doesn't. On the first 'Selection.EntireRow.Delete' it generates the Runtime 1004 Error.
Sheets("Invulblad").Select
ActiveSheet.Unprotect "Password"
Dim ws As Worksheet
Dim tbl1 As ListObject
Dim tbl2 As ListObject
Dim tbl3 As ListObject
Dim tbl4 As ListObject
Dim tbl5 As ListObject
Set ws = Sheets("Invulblad").Select
Set tbl1 = ws.ListObjects("Tabel1")
Set tbl2 = ws.ListObjects("Tabel2")
Set tbl3 = ws.ListObjects("Tabel3")
Set tbl4 = ws.ListObjects("Tabel4")
Set tbl5 = ws.ListObjects("Tabel5")
tbl1.ListRows.Add
tbl2.ListRows.Add
tbl3.ListRows.Add
tbl4.ListRows.Add
tbl5.ListRows.Add
Sheets("Invulblad").Select
Range("Tabel1[[#All],[Afdelingspecifiek]:[Aantal personen]]").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Range("Tabel2[[#All],[Individueel]:[Aantal personen]]").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Range("Tabel3[#All]").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
Range("Tabel4[#All]").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
ActiveWindow.SmallScroll Down:=15
Range("Tabel5[#All]").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete
ActiveSheet.Protect "Password"