• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Blank Rows deletion

amit dani

New Member
Hiii Guys,

I have few excel sheets each containing more than 60000 rows of data. Issue is that after each row there is an blank row.. i have tried to delete by Ctrl + G method, but it says "data range is complex...". I have tried VBA also but every time excel hangs...Can you guys suggest some other ways????

Thanks
 
Possible to sort your data? (I guess not, but worth a try)

This way your selection of blank should become a contiguous range, instead of all over.
 
Hi,

When you say you unmerged them, did you select the whole sheet by clicking on the square in the top left adjacent to column A/Row 1?
 
@Xiq...tried that also...but these blank rows are quite stubborn I must say...they are not going anywhere....

@ThrottleWorks :- I tried below code...its working fine for small range...but can't handle large data...

Code:
Sub RemoveEmpyRows()
' this macro will remove all rows that contain no data
Dim i  As Long
Dim lLastRow As Long
lLastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
Application.ScreenUpdating = False
For i = lLastRow To 1 Step -1
 If WorksheetFunction.CountA(ActiveSheet.Rows(i)) = 0 Then
  ActiveSheet.Rows(i).EntireRow.Delete
 End If
Next i
Application.ScreenUpdating = True
End Sub

I tried macro which you mentioned also...but still same problem...
 
Hi Amit, thanks for the feedback. Glad it is working.

I did not even thought about "Remove Duplicates" really nice.

I tried something, it is far from "being elegant", I think the main issue was with the amount of data.
Excel was getting hang due to large range.

I tried this code with 60,000 rows, worked for me, not able to upload it, file size too heavy.

Happy new year, have a nice year ahead. :)
 

Attachments

  • DeleteRowForAmit.xls
    34.5 KB · Views: 3
Back
Top