Hell All:
I have a worksheet that allows a user to input data. One of the options allows them to click a button and have additional rows added to the table. This part is working fine.
However, when they click the button to export that data as a CSV file, it must remove any empty rows, so the DB will not error by seeing rows of blank data. You see the CSV file is imported into a DB.
For some reason when the "Delete Blanks" routine is called it errors out with an error: "Run-time error '5': Invalid procedure call or argument" The code follows:
Any help would be greatly appreciated.
I have a worksheet that allows a user to input data. One of the options allows them to click a button and have additional rows added to the table. This part is working fine.
However, when they click the button to export that data as a CSV file, it must remove any empty rows, so the DB will not error by seeing rows of blank data. You see the CSV file is imported into a DB.
For some reason when the "Delete Blanks" routine is called it errors out with an error: "Run-time error '5': Invalid procedure call or argument" The code follows:
Code:
Sub Delete_Blank_Rows()
Dim RowCount As Long
Dim LastRow As Integer
Dim tbl As ListObject
RowCount = Sheets("Billing_Data").ListObjects("Table35").Range.Rows.Count
LastRow = RowCount
Set tbl = Range("tblBilling_Data").ListObject
ActiveSheet.Unprotect Password:="password"
tbl.Range("E5:E200").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
ActiveSheet.Protect Password:="password", AllowFiltering:=True, Contents:=True, AllowInsertingRows:=True, AllowDeletingRows:=True, AllowSorting:=True
End Sub
Any help would be greatly appreciated.
Last edited: