FatWhale38
New Member
- Joined
- Nov 2, 2017
- Messages
- 8
- Office Version
- 2007
- Platform
- Windows
Hello
I found the following code on another thread:
Many thanks to the contributors of that thread that came up with that.
I wanted to add on to that thread, but was not sure about hijacking it hence this thread.
I want to modify the above code so it deletes the last ten rows from column D onwards (the last column is a variable)
I initially wanted to do it as an offset from the last row, but couldn't quite figure it out either.
I hope you all can help me.
Many thanks!!!
I found the following code on another thread:
Code:
Sub Delete_Last_10_Rows()
Dim rLastRow As Range
Set rLastRow = Cells(Rows.Count, "C").End(xlUp)
'now delete last 10 rows:
rLastRow.Offset(-9).Resize(10).EntireRow.Delete
MsgBox ("The last 10 Sets of Data is now Deleted")
End Sub
Many thanks to the contributors of that thread that came up with that.
I wanted to add on to that thread, but was not sure about hijacking it hence this thread.
I want to modify the above code so it deletes the last ten rows from column D onwards (the last column is a variable)
I initially wanted to do it as an offset from the last row, but couldn't quite figure it out either.
I hope you all can help me.
Many thanks!!!