View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
SBoostrom SBoostrom is offline
external usenet poster
 
Posts: 2
Default Delete a row when a condition is met using VBA

I need help with VBA code for deleting an enitre row when an condition is
met. This is what I have so far.

Range("A1:T1677").Sort Key1:=Range("L2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Dim Cell As Range
For Each Cell In Range("L2", Range("L5000").Address)
If Cell < 3 Or Cell < 5 Or Cell < 10 Or Cell < 11 Or Cell < 12 Or
Cell < 16 Or Cell < 97 Or Cell < 413 Or Cell < 414 Or Cell < 424 Or Cell
< 431 Then
EntireRow.Delete
End If
Next

End Sub
This is I'm sure not even close but all help os appreciated.

--
Thanks,
Scott