happyhungarian
Active Member
- Joined
- Jul 19, 2011
- Messages
- 252
- Office Version
- 365
- Platform
- Windows
Hi, I'm using this code to find the last 39 rows of a Table and delete them. It works but the only problem is that I would prefer it to delete ONLY the rows from the table; not the entire row from the worksheet. Any easy tweaks to help this?
Sub DeleteTasktoTable()
Dim LC As Long
Dim LR As Long
LC = Cells(2, Columns.Count).End(xlToLeft).Column
LR = Cells(Rows.Count, LC).End(xlUp).Row
Range(Cells(LR - 38, LC), Cells(LR, LC)).EntireRow.Delete Shift:=xlUp
End Sub
Sub DeleteTasktoTable()
Dim LC As Long
Dim LR As Long
LC = Cells(2, Columns.Count).End(xlToLeft).Column
LR = Cells(Rows.Count, LC).End(xlUp).Row
Range(Cells(LR - 38, LC), Cells(LR, LC)).EntireRow.Delete Shift:=xlUp
End Sub