Thread: Delete Rows x-n
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2347_] Rick Rothstein \(MVP - VB\)[_2347_] is offline
external usenet poster
 
Posts: 1
Default Delete Rows x-n

Give this a try...

Sub DeleteAllData()
Dim AddressParts() As String
With Worksheets("Sheet1")
AddressParts = Split(.UsedRange.Address, "$")
.Range("A2:A" & AddressParts(UBound(AddressParts))).EntireRow.Dele te
End With
End Sub

Rick


"Lars Uffmann" wrote in message
...
Hi everyone!

What I want to do is basically
Worksheet.Rows.Delete xlShiftUp
except that I do not want to delete the headings row.

So something like
Worksheet.Rows.Delete (2)
to delete starting from row 2, without having to provide the end of the
range that I am deleting.

Simple question - is there a simple answer?

Thanks!

Lars