Excel - FindNext

S

SJ

I am trying to find text in my file then delete the entire row then find the next occurance of the same text, but my code is getting stuck on the findnext line. This is my code. Can you help me

Sub testcell3(

Range("A6").Selec

With ActiveSheet.Range("a6:I1000"
Set P = .Find(what:="PAYMENT RECEIVED THANK YOU", after:=ActiveCell, LookIn
:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=
xlNext, MatchCase:=False
If Not P Is Nothing The
FirstAddress = P.Addres
D
P.EntireRow.Delete
Set P = .FindNext(P
Loop While Not P Is Nothing And P.Address <> FirstAddres
End I
End Wit

End su
 

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

Top