I am currently using the code below to delete blank rows in tables but this code requires me to list every table separately and run the code on every WS. I was wondering if there was a way to loop through all tables within a WB and delete blank rows in all tables within that WB.
Thank you
Thank you
VBA Code:
Sub sbVBS_To_Delete_Blank_Rows_In_Table()
Dim iCntr As Long
Dim rng As Range
Dim rng2 As Range
Dim rng3 As Range
Set rng = ActiveSheet.ListObjects("Table1").Range
Set rng2 = ActiveSheet.ListObjects("Table2").Range
Set rng3 = ActiveSheet.ListObjects("Table3").Range
For iCntr = rng.row + rng.Rows.Count - 1 To rng.row Step -1
If Application.WorksheetFunction.CountA(Rows(iCntr)) = 0 Then Rows(iCntr).EntireRow.Delete
Next
For iCntr = rng2.row + rng2.Rows.Count - 1 To rng2.row Step -1
If Application.WorksheetFunction.CountA(Rows(iCntr)) = 0 Then Rows(iCntr).EntireRow.Delete
Next
For iCntr = rng3.row + rng3.Rows.Count - 1 To rng3.row Step -1
If Application.WorksheetFunction.CountA(Rows(iCntr)) = 0 Then Rows(iCntr).EntireRow.Delete
Next
End Sub