Thread: Macros
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
tony tony is offline
external usenet poster
 
Posts: 313
Default Macros


Work Great - Thanks

"JLGWhiz" wrote:

Put this in the standard code module1.

Sub delZeros()
Dim lr As Long, sh As Worksheet
lr = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).Row
Set sh = ActiveSheet
For i = lr To 2 Step -1
With sh
If .Range("B" & i).Value = 0 And .Range("B" & i) _
.Value < "" And Not IsEmpty(.Range("B" & i)) Then
sh.Rows(i).Delete
End If
End With
Next
End Sub




"TSVillanova" wrote in message
...
I am new a writing macros and am having a problem writing one that will let
me delete all rows that have a 0 value in cells of column "B" while
leaving
all of the other rows with cells that have values and are blank.

Can anyone help here?
--

TS