View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JD JD is offline
external usenet poster
 
Posts: 7
Default Select last n rows and delete?

Norman Jones wrote:
Hi JD,

Correcting, try:

'=============
Public Sub TesterD()

Dim n As Long

n = 4

Cells(Rows.Count, "B").End(xlUp).Offset(1 - n). _
Resize(n).EntireRow.Delete
End Sub
'<<=============


That one works perfectly, thanks. Question; the resize works as a range
because the variable n has been declared?