View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
lschuh lschuh is offline
external usenet poster
 
Posts: 39
Default vba code doesn't work

I will try this. Thanks.

"Don Guillett" wrote:

you might like this better
Sub deletezero()
For i = ActiveCell.End(xlDown).Row To 1 Step -1
If Cells(i, 1) = 0 Then Rows(i).Delete
Next
End Sub

--
Don Guillett
SalesAid Software

"lschuh" wrote in message
...
I found an example of vba code in a book "Using Excel 2003". It doesn't

work
and locks the entire application up. The code is:
Sub removenull()
Application.ScreenUpdating = False
Do Until ActiveCell.Value = " "
If ActiveCell.Value = 0 Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub


It is supposed to remove 0 from rows and delete rows.

What is wrong with it?