View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Need a macro to delete rows

I may have misreda your post if you reall mean delete the rows as opposed to
clear the contents then use this instead

Sub marine()
lastrow = Range("A3").End(xlDown).Row
Range("A3:A" & lastrow - 1).EntireRow.Delete
End Sub

Mike

"Mike H" wrote:

Try

Sub marine()
lastrow = Range("A3").End(xlDown).Row
Range("A3:A" & lastrow - 1).EntireRow.ClearContents
End Sub

Mike

"jmr4h8" wrote:

I need to find the first data occurance in column D and delete all rows above
it except rows 1 and 2.