View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Noob McKnownowt Noob McKnownowt is offline
external usenet poster
 
Posts: 37
Default how to delete a row based on a condition



"ya" wrote:

how to delete a row based on a condition


If you could provide us with a little more information that would help, but
a general answer would be somethin like;

Sub DelRow()

Dim Rng as Range
Dim Cell as Range

set Rng = Sheet("the sheet you want to check").Range(The range on the sheet
you want to search. i.e. "D:D")

For Each Cell in Rng
If Cell.Value = "what you want to search for" Then
Cell.EntireRow.Delete
End If
Next Cell

End Sub

HTH,

The Noob