View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Delete empty rows.

Hi Steve Try,

'=======================
Public Sub Tester02()
Dim Rng As Range, Rng1 As Range

Set Rng = Range("A1:K30") '<<====== CHANGE to suit

On Error Resume Next
Set Rng1 = Intersect(Rng, _
Columns("B:B").SpecialCells(xlBlanks))
On Error GoTo 0

If Not Rng1 Is Nothing Then Rng1.EntireRow.Delete

End Sub
'<<=======================


Change address of Rng to limit the rows to be deleted.

---
Regards,
Norman



"Steve" wrote in message
...
This works great, however, is there a way to limit it to a range instead
of
applying it to the entire wksht.

Steve

"Norman Jones" wrote:

Hi Steve,

Try:

'=======================
Public Sub Tester02()
On Error Resume Next
Columns("B:B").SpecialCells(xlBlanks). _
EntireRow.Delete
On Error GoTo 0
End Sub
'<<=======================

Alternatively, look at using the AutoFilter featutre.

---
Regards,
Norman



"Steve" wrote in message
...
I am looking for a macro to auto-delete rows that are empty between
columns
A and N. The main column I am concerned with is B. If B? is empty,
delete
the
entire row.

Thanks for your time and help,
Steve