I have code that looks at a column of data and deletes any rows with zeros in them... here it is
Dim Col As Integer
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row
'Now give a numerical no. of column you want to search through
Col = Application.InputBox(prompt:="Give a column number, please:")
Do While LastRow > 1
Cells(LastRow, Col).Select
If Cells(LastRow, Col) = 0 Then
Rows(LastRow).EntireRow.Delete
End If
LastRow = LastRow - 1
Loop
The problem is it deletes blank cells as well.
Can anyone help with how to delete only the zero rows and leave the blank rows?
Thanks[/code]
Dim Col As Integer
Dim LastRow As Long
LastRow = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row
'Now give a numerical no. of column you want to search through
Col = Application.InputBox(prompt:="Give a column number, please:")
Do While LastRow > 1
Cells(LastRow, Col).Select
If Cells(LastRow, Col) = 0 Then
Rows(LastRow).EntireRow.Delete
End If
LastRow = LastRow - 1
Loop
The problem is it deletes blank cells as well.
Can anyone help with how to delete only the zero rows and leave the blank rows?
Thanks[/code]