Thread: Delete Rows
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
enyaw enyaw is offline
external usenet poster
 
Posts: 108
Default Delete Rows

I have this code for deleting the last row inserted from a form. I need to
edit this so as to ignore the first row. How could I do this?
Private Sub CommandButton6_Click()
Dim LastRowOnSheet As Long

LastRowOnSheet = Sheets("Sheet1").UsedRange.Rows.Count +
Sheets("Sheet1").UsedRange.row - 1
Sheets("Sheet1").Cells(LastRowOnSheet, 1).EntireRow.Delete


End Sub