Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
gwc gwc is offline
external usenet poster
 
Posts: 62
Default Delete extra empty rows

How can I delete all but one empty row between each row or group of
consecutive rows containing data?

Here is portion of my spreadsheet:

xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx



xxxxxxx
xxxxxxx
xxxxxxx

xxxxxxxx
xxxxxxxx






xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx

xxxxxxxx
xxxxxxxx

xxxxxxxx




xxxxxxxxx
xxxxxxxxx

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Delete extra empty rows


Sub deleteallbutoneblankrowSAS()
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i, 1) = "" And Cells(i + 1, 1) = "" _
Then Rows(i + 1).Delete
Next i
End Sub
=======

On Feb 13, 12:01*pm, gwc wrote:
How can I delete all but one empty row between each row or group of
consecutive rows containing data?

Here is portion of my spreadsheet:

xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx

xxxxxxx
xxxxxxx
xxxxxxx

xxxxxxxx
xxxxxxxx

xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx

xxxxxxxx
xxxxxxxx

xxxxxxxx

xxxxxxxxx
xxxxxxxxx


  #3   Report Post  
Posted to microsoft.public.excel.misc
gwc gwc is offline
external usenet poster
 
Posts: 62
Default Delete extra empty rows

On Feb 13, 12:00*pm, Don Guillett wrote:
Sub deleteallbutoneblankrowSAS()
Dim i As Long
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
If Cells(i, 1) = "" And Cells(i + 1, 1) = "" _
Then Rows(i + 1).Delete
Next i
End Sub
=======

On Feb 13, 12:01*pm, gwc wrote:



How can I delete all but one empty row between each row or group of
consecutive rows containing data?


Here is portion of my spreadsheet:


xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx
xxxxxxx


xxxxxxx
xxxxxxx
xxxxxxx


xxxxxxxx
xxxxxxxx


xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxx


xxxxxxxx
xxxxxxxx


xxxxxxxx


xxxxxxxxx
xxxxxxxxx- Hide quoted text -


- Show quoted text -


Thanks.

Reply
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
Cannot delete extra rows jmj713 Excel Discussion (Misc queries) 6 January 8th 09 09:23 PM
How to delete extra rows from bottom? Lentenrose Excel Discussion (Misc queries) 1 November 10th 06 05:23 PM
Delete Rows with Empty Cells with empty column 1 Scott Excel Programming 5 October 2nd 06 11:57 PM
how do i delete the extra empty rows and columns that i dont need. lindaY Excel Discussion (Misc queries) 3 March 20th 05 03:48 PM
Delete extra rows at the end of macro run jmatchus[_2_] Excel Programming 2 January 23rd 04 01:48 PM


All times are GMT +1. The time now is 10:00 PM.

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

About Us

"It's about Microsoft Excel"