VB code Required-------!

  • Thread starter Thread starter Thyagaraj
  • Start date Start date
T

Thyagaraj

Dear Friends,

I Want to delete a row based on the existence of a particular data.

ie.,

If any cell in the active sheet consists " Problem " then it should
delete the entire row....!

Can any body help..?


Thanks in Advance

Regards
Thyagaraj
 
Sub DeleteRows()
Dim FirstInstance As Range
Do
Set FirstInstance = Cells.Find(What:=" Problem ",
After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False)
If Not FirstInstance Is Nothing Then
FirstInstance.EntireRow.Delete
Loop While Not FirstInstance Is Nothing
End Sub

HTH

Die_Another_Day
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top