View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BOSS BOSS is offline
external usenet poster
 
Posts: 123
Default delete row on basic of cell

HI,

I wish to delete entire row if value in col J is "--"

I did some work but not working properly.
data id huge of 400 rows.

Thanks for help.
Boss


Sub delete()
Dim rng As Range
Dim rngAll As Range

Set rngAll = Range("j:j")

For Each rng In rngAll
If rng.Value = "--" Then

rng.EntireRow.Delete
End If
Next rng

Set rng = Nothing
Set rngAll = Nothing

End Sub