Thread: Simple Macro?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tatebana Tatebana is offline
external usenet poster
 
Posts: 20
Default Simple Macro?

Why does the following macro jump to End Sub after it encountered the first
cell with 0 (zero) value instead of deleting the entire row?

Values to be tested are in column B

Sub RemoveRow()
Range("B2:B30").Select
Do Until ActiveCell.Value = 0
If ActiveCell.Value = 0 Then
ActiveCell.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub