View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Foss Foss is offline
external usenet poster
 
Posts: 22
Default Deleting empty rows

Hi Tom

Thanks for the tip, that's a handy one

Cheers
Fos

----- Tom Ogilvy wrote: ----

If you can make the determination on a single column (if a cell in tha
column is blank, then delete) and the cells are actually blank, not jus
appear blank but contain a formula, and the number of non-contiguous area
are less thant 8192 you can quickly delete wit

On Error Resume Nex
Columns(1).Specialcells(xlBlanks).EntireRow.Delet
On Error goto

1 specifies column A, adjust as needed

--
Regards
Tom Ogilv


"Ron de Bruin" wrote in messag
..
Try this Fos
Sub Example1(

Dim Firstrow As Lon
Dim Lastrow As Lon
Dim Lrow As Lon
Dim CalcMode As Lon
With Applicatio

CalcMode = .Calculatio
.Calculation = xlCalculationManua
.ScreenUpdating = Fals
End Wit
Firstrow = ActiveSheet.UsedRange.Cells(1).Ro

Lastrow = ActiveSheet.UsedRange.Rows.Count + Firstrow -
With ActiveShee
.DisplayPageBreaks = Fals
For Lrow = Lastrow To Firstrow Step -
If Application.CountA(.Rows(Lrow)) = 0 Then .Rows(Lrow).Delet

'This will delete the row if the whole row is empty (al

columns
Nex

End Wit
With Applicatio
.ScreenUpdating = Tru
.Calculation = CalcMod
End Wit
End Su
--

Regards Ron de Brui
http://www.rondebruin.n
"Foss" wrote in messag

..
Good afternoon all
Does anyone have something nice and quick that can delete all empty row

in the UsedRange
Thanks for your time

Fos