Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to be able to delete blank lines in a macro, and the only VBA code I
can find doesn't work if there's a formula in the cell, even if the value is zero. I tried copying and pasting special (Values), but even though the formula isn't there any more, it still won't delete that line. I would appreciate any suggestions. -- Message posted via http://www.officekb.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Frank
Do you check one column ? Here is a example for the A column (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 IsError(.Cells(Lrow, "A").Value) Then 'Do nothing, This avoid a error if there is a error in the cell ElseIf .Cells(Lrow, "A").Value = "" Then .Rows(Lrow).Delete End If Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Frank via OfficeKB.com" wrote in message ... I need to be able to delete blank lines in a macro, and the only VBA code I can find doesn't work if there's a formula in the cell, even if the value is zero. I tried copying and pasting special (Values), but even though the formula isn't there any more, it still won't delete that line. I would appreciate any suggestions. -- Message posted via http://www.officekb.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
WOW! That was great! Thank you so very much. I have tried and tried to make
this work. I'd buy you lunch if you were here. -- Message posted via http://www.officekb.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Frank via OfficeKB.com" wrote in message ... I need to be able to delete blank lines in a macro, and the only VBA code I can find doesn't work if there's a formula in the cell, even if the value is zero. Why not? Paste your c ode. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Blank Lines | Excel Discussion (Misc queries) | |||
Macro not recognizing blank lines as blank | Excel Discussion (Misc queries) | |||
blank lines at end | Excel Programming | |||
Blank lines | Excel Programming | |||
how to automatically insert blank lines in between non-blank lines | Excel Programming |