srinidhi
Active Member
Hi,
I have a set of numbers like
1234
3446
0
3050
3450
0456
0
0
890890
I want to delete the rows which contains only 0
Below I have pasted the macros but it is deleting 0 from the numbers also. I just want to delete the row which has only 0 and does not have any other number with it.
Private Sub Delete()
Dim intRow
Dim intLastRow
intLastRow = Range("1000").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value = 0 Or Cells(intRow, 1) = "" Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub
I have a set of numbers like
1234
3446
0
3050
3450
0456
0
0
890890
I want to delete the rows which contains only 0
Below I have pasted the macros but it is deleting 0 from the numbers also. I just want to delete the row which has only 0 and does not have any other number with it.
Private Sub Delete()
Dim intRow
Dim intLastRow
intLastRow = Range("1000").End(xlUp).Row
For intRow = intLastRow To 1 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value = 0 Or Cells(intRow, 1) = "" Then
Cells(intRow, 1).Select
Selection.EntireRow.Delete
End If
Next intRow
Range("A1").Select
End Sub