robertdseals
Active Member
- Joined
- May 14, 2008
- Messages
- 327
- Office Version
-
- 2010
- Platform
-
- Windows
Hello,
I'm using this to delete a row based on if a cell has a value of zero. However, I would like to delete the row with the value of zero and the row under it also.
Sub DeleteZeroRow()
'Updateby20140616
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
Do
Set Rng = WorkRng.Find("0", LookIn:=xlValues)
If Not Rng Is Nothing Then
Rng.EntireRow.Delete
'Rows(ActiveCell.Row).Delete
End If
Loop While Not Rng Is Nothing
Application.ScreenUpdating = True
End Sub
I'm using this to delete a row based on if a cell has a value of zero. However, I would like to delete the row with the value of zero and the row under it also.
Sub DeleteZeroRow()
'Updateby20140616
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
Application.ScreenUpdating = False
Do
Set Rng = WorkRng.Find("0", LookIn:=xlValues)
If Not Rng Is Nothing Then
Rng.EntireRow.Delete
'Rows(ActiveCell.Row).Delete
End If
Loop While Not Rng Is Nothing
Application.ScreenUpdating = True
End Sub