View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
Colin Hayes Colin Hayes is offline
external usenet poster
 
Posts: 465
Default Macro to Delete the last N rows

In article
, Don
Guillett writes
I think my original did the same thing but, A bit of improvement to yours

option explicit

Sub Delete_N_Rows_From_End()
Dim lrow As Long
dim n as long

*lrow = UsedRange.Rows.Count + 1
n = Application.InputBox("Delete how many rows from bottom of sheet?",*"Input
Please ...", 0)*If n
= False Then Exit Sub*Range(Cells(lrow, 1), Cells(lrow - n, 1)).EntireRow.Delete*'ro
ws(lr).resize(lrow
-n).delete ' works the same End Sub





HI Don

OK thanks for that refinement and for your expertise.



Best Wishes