Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Try this example for row 1 - 100 Sub Example2() Dim Lrow As Long Dim CalcMode As Long Dim StartRow As Long Dim EndRow As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With With ActiveSheet .DisplayPageBreaks = False StartRow = 1 EndRow = 100 For Lrow = EndRow To StartRow Step -1 If Application.CountA(.Rows(Lrow)) = 0 Then .Rows(Lrow).Delete 'This will delete the row if the whole row is empty (all columns) Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "p. panter" wrote in message ... Hello, how can I delete just empty rows of a sheet with the following code I can just delete empty cells and after that the rows are not the same as before (have different values). Sub emptyCellsDelete() sheet1.Cells.Range("A6:M155").SpecialCells _ (xlCellTypeBlanks).Delete shift:=xlUp End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
How to Delete empty rows in excel in b/w rows with values | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete empty rows | Excel Programming | |||
Delete empty rows | Excel Programming |