Hi everyone, i have this code that delete rows with values 0 in column I.
Sub DeleteZeroRows()
Dim Zeroes As Range
'assuming that column I is the one that needs to be checked
'"I" states that it is in column I. change to your desired column alphabet.
Const AccountColumn As String = "I"
With Columns(AccountColumn)
'number 0s is all deleted (rows)
.Replace "0", "=0", xlWhole
On Error Resume Next
.SpecialCells(xlFormulas).EntireRow.Delete
End With
End Sub
When i run the macro, whenver there is a value with 0, i will delete the row. And the row shifts up. i would like to do it this way:
delete rows with values 0. Then count the number of rows deleted. and add the number of rows below the leftover rows.
thanks
Sub DeleteZeroRows()
Dim Zeroes As Range
'assuming that column I is the one that needs to be checked
'"I" states that it is in column I. change to your desired column alphabet.
Const AccountColumn As String = "I"
With Columns(AccountColumn)
'number 0s is all deleted (rows)
.Replace "0", "=0", xlWhole
On Error Resume Next
.SpecialCells(xlFormulas).EntireRow.Delete
End With
End Sub
When i run the macro, whenver there is a value with 0, i will delete the row. And the row shifts up. i would like to do it this way:
delete rows with values 0. Then count the number of rows deleted. and add the number of rows below the leftover rows.
thanks