View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
steven steven is offline
external usenet poster
 
Posts: 389
Default deleting "0" rows

Hello,

I have this code and it works perfectly for me (see code below). I want to
simplify it so it dosent ask me for which column to delete "0" from. This
column is always J in my worksheet. Can't figure it out though, whats the
right code?

Thanks...

Sub deletezeros()

colabel = InputBox("column label to delete zeros (ex. A, B, C...)")
lrow = Cells(Rows.Count, colabel).End(xlUp).Row
For i = lrow To 1 Step -1
If Cells(i, colabel) = 0 Then Rows(i).Delete
Next i

End Sub