Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default deleting the blank rows from the sheet

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default deleting the blank rows from the sheet

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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default deleting the blank rows from the sheet

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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 396
Default deleting the blank rows from the sheet

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.Delet e
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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default deleting the blank rows from the sheet

Select a column and F5SpecialBlanksOK

EditDeleteEntire Row.


Gord Dibben MS Excel MVP

On Mon, 9 Jul 2007 01:12:07 -0700, 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
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
MACRO HELP - deleting rows containing a range of blank cells DavidHawes Excel Discussion (Misc queries) 9 February 26th 07 03:40 PM
How paste Rows with Blank cells into New sheet in the same Workboo Coomo1 Excel Discussion (Misc queries) 1 November 17th 06 01:57 PM
Deleting blank rows Yvette Excel Worksheet Functions 3 June 9th 06 10:30 AM
Deleting Blank Rows Reeni New Users to Excel 4 December 15th 05 01:56 AM
Deleting rows with blank cells Batman Excel Worksheet Functions 10 February 16th 05 06:01 PM


All times are GMT +1. The time now is 08:35 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"