Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi Guys im trying to delete empty rows with a macro using the following vba
however the rows have been copied from another sheet and pasted as values that were from formulas so the 'empty' rows actually contain a lot of "0"'s. the code im using only seems to delete rows with nothing in the row at all. is there a way to tell the macro to delete rows that have zeros in them? Thanks heaps scott Sub Example2() Dim Lrow As Long Dim CalcMode As Long Dim ViewMode As Long Dim StartRow As Long Dim EndRow As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With ViewMode = ActiveWindow.View ActiveWindow.View = xlNormalView With ActiveSheet .DisplayPageBreaks = False StartRow = 2 EndRow = 253 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 ActiveWindow.View = ViewMode With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Deleting rows with macro | Excel Worksheet Functions | |||
Macro deleting specified rows | Charts and Charting in Excel |