I have the following code:
Dim listobj As ListObject Dim lastrow As Integer For Each listobj In ActiveSheet.ListObjects With listobj lastrow = .ListRows.Count If lastrow > 0 Then If Application.WorksheetFunction.CountA(.ListRows(lastrow)) = 0 Then .ListRows(lastrow).Delete End If End If End With Next
It should loop through all the tables on the activesheet, and if the last row is blank, it should delete that row.
However I am getting a Error: "Unable to get CountA property of the worksheetfunction class"
Ps. If the fisrt row and the last row are the same, then leave it would be the ideal.