PC Review


Reply
Thread Tools Rate Thread

deleting blank rows for up to 60000 rows of data

 
 
gbpg
Guest
Posts: n/a
 
      27th Dec 2009
I have worksheets with up to 60000 rows in one column I have tried using the
following macro from this site and it does not do anything. Any ideas?:

Sub Sonic()
Dim i As Long
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
Lastrow = ActiveSheet.UsedRange.Rows.Count
For i = Lastrow To 1 Step -1
If WorksheetFunction.CountA(Rows(i)) = 0 Then
Rows(i).EntireRow.Delete
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub

 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      27th Dec 2009
Hi,

The code works fine for me. One point is the entire row must be empy before
it will be selected for deletion. i.e a formula thta returns a null string
and looks empty won't be deleted.

Sub Sonic()
Dim i As Long
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
Lastrow = ActiveSheet.UsedRange.Rows.Count
For i = Lastrow To 1 Step -1
If WorksheetFunction.CountA(Rows(i)) = 0 Then
Rows(i).EntireRow.Delete
End If
Next i
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub

Mike

"gbpg" wrote:

> I have worksheets with up to 60000 rows in one column I have tried using the
> following macro from this site and it does not do anything. Any ideas?:
>
> Sub Sonic()
> Dim i As Long
> With Application
> .Calculation = xlCalculationManual
> .ScreenUpdating = False
> Lastrow = ActiveSheet.UsedRange.Rows.Count
> For i = Lastrow To 1 Step -1
> If WorksheetFunction.CountA(Rows(i)) = 0 Then
> Rows(i).EntireRow.Delete
> End If
> Next i
> .Calculation = xlCalculationAutomatic
> .ScreenUpdating = True
> End With
> End Sub
>

 
Reply With Quote
 
Noe
Guest
Posts: n/a
 
      27th Dec 2009
Noe,

I hope this is work for you
Sub Delete_Rows()
Range("C1").Select



a = 0



Do While a <> 1

If ActiveCell.Value = Empty Then
Selection.EntireRow.Delete
Else




End If



If ActiveCell.Value = "BLANK" Then

a = 1

Else

ActiveCell.Offset(1, 0).Activate



End If

Loop
Application.CutCopyMode = False
Range("A2").Select

End Sub




"gbpg" wrote:

> I have worksheets with up to 60000 rows in one column I have tried using the
> following macro from this site and it does not do anything. Any ideas?:
>
> Sub Sonic()
> Dim i As Long
> With Application
> .Calculation = xlCalculationManual
> .ScreenUpdating = False
> Lastrow = ActiveSheet.UsedRange.Rows.Count
> For i = Lastrow To 1 Step -1
> If WorksheetFunction.CountA(Rows(i)) = 0 Then
> Rows(i).EntireRow.Delete
> End If
> Next i
> .Calculation = xlCalculationAutomatic
> .ScreenUpdating = True
> End With
> End Sub
>

 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      27th Dec 2009
Hi

Try this one liner, just change the column letter to suit:

Sub DeleteEmptyRows()
Columns("B").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub

Regards,
Per

On 27 Dec., 09:26, gbpg <g...@discussions.microsoft.com> wrote:
> I have worksheets with up to 60000 rows in one column I have tried using the
> following macro from this site and it does not do anything. Any ideas?:
>
> Sub Sonic()
> Dim i As Long
> With Application
> * * .Calculation = xlCalculationManual
> * * .ScreenUpdating = False
> * * Lastrow = ActiveSheet.UsedRange.Rows.Count
> * * For i = Lastrow To 1 Step -1
> * * * * If WorksheetFunction.CountA(Rows(i)) = 0 Then
> * * * * * * Rows(i).EntireRow.Delete
> * * * * End If
> * * Next i
> * * * * .Calculation = xlCalculationAutomatic
> * * * * .ScreenUpdating = True
> * * End With
> End Sub


 
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 63,886 Blank Rows Under My Data Kajuliano Microsoft Excel Misc 15 19th Jan 2009 08:50 PM
Deleting Blank rows after Data-TJ ambushsinger Microsoft Access VBA Modules 1 16th Dec 2008 05:14 PM
Copy rows of data (eliminating blank rows) from fixed layout =?Utf-8?B?U3dlZXBlYQ==?= Microsoft Excel Misc 1 13th Mar 2007 11:05 PM
Deleting rows of blank data Ken Microsoft Excel Worksheet Functions 7 13th Apr 2004 05:16 AM
Inserting blank rows between data rows (mutliple at one time) DP Microsoft Excel Misc 2 21st Oct 2003 06:21 PM


Features
 

Advertising
 

Newsgroups
 


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