Hi
I'm trying to come up with a macro for a button to be able to delete rows from a table that are empty, starting from the top (most recent).
I have a macro that will add new rows at the top (at Row 2), but I need one to delete rows from the top (Row 2), too.
The macro I have currently is:
Sub DelLR()
Dim x As Long
With Sheets("Sheet1")
'Assumes last row of data found in column A (1)
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(x, 1).EntireRow.Delete
End With
End Sub
I'd also like to tweak the macro so that it won't allow the user to delete any rows that are already filled in (so only deletes empty rows) from the top downwards.
Thanks guys!
I'm trying to come up with a macro for a button to be able to delete rows from a table that are empty, starting from the top (most recent).
I have a macro that will add new rows at the top (at Row 2), but I need one to delete rows from the top (Row 2), too.
The macro I have currently is:
Sub DelLR()
Dim x As Long
With Sheets("Sheet1")
'Assumes last row of data found in column A (1)
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(x, 1).EntireRow.Delete
End With
End Sub
I'd also like to tweak the macro so that it won't allow the user to delete any rows that are already filled in (so only deletes empty rows) from the top downwards.
Thanks guys!