deleting rows
Use
If cell.Value = 0 Then cell.EntireRow.Delete
regards,
Don Lloyd
--
"Andy Copeland" wrote in message
...
Hi,
I am trying to delete all the rows where a zero value is in
column C. This is what I came up with but it deletes everything in the
column and none of the rows. I appreciate any help. I am using Excel
2000.
Thanks.
Sub DeleteRows()
If TypeName(Selection) < "Range" Then Exit Sub
On Error Resume Next
For Each Cell In Selection
If Cell.Value = 0 Then Row.Select = True Else Row.Select False
If Selection = True Then Selection.Delete
Next Cell
End Sub
|