PC Review


Reply
Thread Tools Rate Thread

Delete extra empty rows

 
 
gwc
Guest
Posts: n/a
 
      13th Feb 2012
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

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      13th Feb 2012

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 <gcott...@hotmail.com> 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


 
Reply With Quote
 
gwc
Guest
Posts: n/a
 
      14th Feb 2012
On Feb 13, 12:00*pm, Don Guillett <dguille...@gmail.com> 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 <gcott...@hotmail.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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



Features
 

Advertising
 

Newsgroups
 


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