View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Delete 3 end row

Hi,

This will clear the last 3 rows of the active sheet. Note I the on error
line is to cope when there are less than 3 rows on the sheet

Sub del_Last_3()
Dim LastRow As Long
On Error Resume Next
LastRow = ActiveSheet.Cells.Find(What:="*", _
SearchDirection:=xlPrevious, _
SearchOrder:=xlRows).Row
ActiveSheet.Rows(LastRow - 2 & ":" & LastRow).ClearContents
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"climate" wrote:

Hi
I want to delete three end row of any sheet. any sheet has different row
number.
Thank's for any help.

your's