PC Review


Reply
Thread Tools Rate Thread

deleting the blank rows from the sheet

 
 
=?Utf-8?B?bWFudQ==?=
Guest
Posts: n/a
 
      9th Jul 2007
Hi

Thanx for replying me in time for my earlier question.

I have a data of 15000 rows. My problem is there are spaces of a row or two
between each records. I could have sort it to remove the blank rows in
between. But do not want to change the order of the records. pls suggest
the right way to remove blank rows from the records in short period of time.

thanx in advance.
Manu
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      9th Jul 2007
Hi,

I have assumed that if the cell in column A is empty then this identifies a
blank row. If that is correct then right click the sheet tab, view code and
paste this in:-

Sub surface()
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With

For x = LastRow To 1 Step -1
Cells(x, 1).Select
If Cells(x, 1).Value = "" Then
Selection.EntireRow.Delete
End If
Next
End Sub

Mike


"manu" wrote:

> Hi
>
> Thanx for replying me in time for my earlier question.
>
> I have a data of 15000 rows. My problem is there are spaces of a row or two
> between each records. I could have sort it to remove the blank rows in
> between. But do not want to change the order of the records. pls suggest
> the right way to remove blank rows from the records in short period of time.
>
> thanx in advance.
> Manu

 
Reply With Quote
 
=?Utf-8?B?bWFudQ==?=
Guest
Posts: n/a
 
      9th Jul 2007
Its working.

Thanx a lot.

rgds,
Manu

"Mike H" wrote:

> Hi,
>
> I have assumed that if the cell in column A is empty then this identifies a
> blank row. If that is correct then right click the sheet tab, view code and
> paste this in:-
>
> Sub surface()
> With ActiveSheet
> LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
> End With
>
> For x = LastRow To 1 Step -1
> Cells(x, 1).Select
> If Cells(x, 1).Value = "" Then
> Selection.EntireRow.Delete
> End If
> Next
> End Sub
>
> Mike
>
>
> "manu" wrote:
>
> > Hi
> >
> > Thanx for replying me in time for my earlier question.
> >
> > I have a data of 15000 rows. My problem is there are spaces of a row or two
> > between each records. I could have sort it to remove the blank rows in
> > between. But do not want to change the order of the records. pls suggest
> > the right way to remove blank rows from the records in short period of time.
> >
> > thanx in advance.
> > Manu

 
Reply With Quote
 
=?Utf-8?B?V2lnaQ==?=
Guest
Posts: n/a
 
      9th Jul 2007
Personally, I would use:

Sub surface()

Dim rng As Range

Set rng = Application.Intersect(Cells.Columns(1), ActiveSheet.UsedRange)

On Error Resume Next
rng.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
On Error GoTo 0

End Sub


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Mike H" wrote:

> Hi,
>
> I have assumed that if the cell in column A is empty then this identifies a
> blank row. If that is correct then right click the sheet tab, view code and
> paste this in:-
>
> Sub surface()
> With ActiveSheet
> LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
> End With
>
> For x = LastRow To 1 Step -1
> Cells(x, 1).Select
> If Cells(x, 1).Value = "" Then
> Selection.EntireRow.Delete
> End If
> Next
> End Sub
>
> Mike

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      9th Jul 2007
Select a column and F5>Special>Blanks>OK

Edit>Delete>Entire Row.


Gord Dibben MS Excel MVP

On Mon, 9 Jul 2007 01:12:07 -0700, manu <(E-Mail Removed)> wrote:

>Hi
>
>Thanx for replying me in time for my earlier question.
>
>I have a data of 15000 rows. My problem is there are spaces of a row or two
>between each records. I could have sort it to remove the blank rows in
>between. But do not want to change the order of the records. pls suggest
>the right way to remove blank rows from the records in short period of time.
>
>thanx in advance.
>Manu


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting Blank Rows at end of sheet RLN Microsoft Excel Programming 6 31st Aug 2009 04:36 PM
Deleting blank rows which contain blank drop-down list boxes Al Microsoft Excel Programming 2 18th Feb 2009 01:37 PM
Deleting blank rows at the end of the sheet! jaclyn Microsoft Excel Misc 5 4th Oct 2003 06:09 PM
Re: Deleting blank rows at the end of the sheet! Ron de Bruin Microsoft Excel Misc 0 3rd Oct 2003 11:05 PM
Re: Deleting blank rows at the end of the sheet! Debra Dalgleish Microsoft Excel Misc 0 3rd Oct 2003 10:47 PM


Features
 

Advertising
 

Newsgroups
 


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