LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Delete empty rows.

Worked like a charm. Thanks.

"Norman Jones" wrote:

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











 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
How to Delete empty rows in excel in b/w rows with values Dennis Excel Worksheet Functions 3 August 28th 07 04:15 PM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Excel Worksheet Functions 0 December 13th 06 01:25 AM
delete empty rows hans[_3_] Excel Programming 1 April 13th 04 12:39 PM
Delete rows if they are empty chrismania[_3_] Excel Programming 2 October 18th 03 04:27 PM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"