Thread: delete rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default delete rows

You will need to adjust to your file criteria.

Sub DelRw()
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
For i = lstRw To 2 Step -1 'Assumes Header Row
If Cells(i, 1) = "" Then 'Change col 1 to actual
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

"Ivor Williams" wrote:

I've a spreadsheet of inventory information that was exported from
QuickBooks. The resulting spreadsheet contains a number of rows with no
information in the column I want to sort on, so I would like to
automatically delete those rows. I'm totally new to writing VBA for Excel,
but I'm quite comfortable with it in Access, so understand it somewhat. I
also understand I can modify the QuickBooks report so the spreadsheet is
created in a format that will work, but I would like some assistance with
the code so I can start to learn what I'm doing in Excel.

Thanks,
Ivor