Hi I've come across the following code which checks for any blank data in a table column and deletes the blank rows. It works great when there are blank rows or where there are multiple rows of data and no blank rows.
It errors out when there is only 1 row of data and no blank rows....I get the following error..."Run-time errir '1004': This won't work because it would move cells in a table on your worksheet.
Any help would be appreciated.
Thanks, Steven
It errors out when there is only 1 row of data and no blank rows....I get the following error..."Run-time errir '1004': This won't work because it would move cells in a table on your worksheet.
Code:
Sub ResizeTable3()
Dim Rng As Range
On Error Resume Next
Set Rng = Range("Table3[[Staff]]").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not Rng Is Nothing Then
Rng.Delete Shift:=xlUp
End If
Any help would be appreciated.
Thanks, Steven