PDA

View Full Version : Solved: select last 5 rows



asdzxc
12-22-2012, 04:25 AM
copy last 5 rows then to paste to A2 and finally to delete
rows starting from row7th, plse write vba.

patel
12-22-2012, 05:06 AM
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
Range("A2:A" & LR - 5).EntireRow.Delete
End Sub

asdzxc
12-22-2012, 05:09 AM
Sub a()
LR = Cells(Rows.Count, "A").End(xlUp).Row
Range("A2:A" & LR - 5).EntireRow.Delete
End Sub


sloved with thanks

Aussiebear
12-22-2012, 05:16 AM
To mark your thread solved simply click on the dropdown Thread Tools and select the correct option. I have done this for you this time