Thread: Delete Rows x-n
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Delete Rows x-n

in any event, maybe you can amend this coding:
======================
Option Explicit

Sub Lars()


Dim myLastRow As Long
Dim r As Long
Dim c As Range


myLastRow = ActiveSheet.Cells(10000, 1).End(xlUp).Row


For r = myLastRow To 1 Step -1
Set c = ActiveSheet.Range("a" & r)
If c.Value = "" Then
c.EntireRow.Delete
End If
Next r


End Sub
=========================
it looks at column A for blanks and uses the bottom of the range as
being the last populated cell in column A.
if you changed
myLastRow to 1
to
myLastRow to 2
then you'd keep row 1, your header row.
hope it helps.
susan


On Jul 21, 11:17*am, Lars Uffmann wrote:
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