Loop That Deletes Blank Rows
Loop That Deletes Blank Rows
(OP)
I have a worksheet that contains a table, the entries in the table vary, so I need the table to adjust to the amount of entries in the table, so there isn't blank rows that are formatted with borderlines.
I was thinking something like "If Range is "", then delete..." That sort of logic, or maybe even something better if anyone knows.
Thanks in advance for any help you can give.
Anthony
I was thinking something like "If Range is "", then delete..." That sort of logic, or maybe even something better if anyone knows.
Thanks in advance for any help you can give.
Anthony
RE: Loop That Deletes Blank Rows
Private Sub CommandButton1_Click()
Dim intRow As Integer
For intRow = 20 To 1 Step -1
With Range("A" & intRow)
If .Value = "" Then
Rows(intRow).Delete Shift:=xlUp
End If
End With
Next intRow
End Sub
That should get you started
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
RE: Loop That Deletes Blank Rows