View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default Deleting rows with blank cells

Hi jim_0068,

I've had a similar problem with the SpecialCells method. I forget the
details.
My solution is to loop through the rows starting at LastRw up to row 1
(you might want to change the 1 to what ever top row you want to loop
to)
Test the following out on a backup copy of your data....


Public Sub DeleteRowBBlank()
Dim iRowCounter As Long
Dim Lastrw As Long
Lastrw = ActiveSheet.Cells(Rows.Count, "b").End(xlUp).Row
For iRowCounter = Lastrw To 1 Step -1
If Cells(iRowCounter, 2) = "" Then
Cells(iRowCounter, 2).EntireRow.Delete
End If
Next
End Sub

Ken Johnson