thewiseguy
Well-known Member
- Joined
- May 23, 2005
- Messages
- 1,019
- Office Version
- 365
- Platform
- Windows
Hi everyone,
Here is my code to delete all rows with value "0" in column C.
Sub DeleteRowOnCell7()
For i = 450 To 1 Step -1
If Cells(i, "C").Value = "0" Then Rows(i).EntireRow.Delete
Next i
End Sub
At the end of all of my data. I have 2 rows worth of totals. The problem I am having is that once the code is run, there is a big gap between my data and my totals of all the data. Is there a way to get the totals (in rows 456 and 457) to move upward as the "0" value cells are deleted?
Here is my code to delete all rows with value "0" in column C.
Sub DeleteRowOnCell7()
For i = 450 To 1 Step -1
If Cells(i, "C").Value = "0" Then Rows(i).EntireRow.Delete
Next i
End Sub
At the end of all of my data. I have 2 rows worth of totals. The problem I am having is that once the code is run, there is a big gap between my data and my totals of all the data. Is there a way to get the totals (in rows 456 and 457) to move upward as the "0" value cells are deleted?