Works beautifully but stops half way through

  • Thread starter Thread starter kimbroughton
  • Start date Start date
K

kimbroughton

Hi,
I found this script in this group and changed it to my parameters. It
is finding a 10 line by 2 column wide header on the top of every page
of a file I imported and removing it. It works great but for some
reason it stops on line 32785. There are 54733 lines in the file. I
was hoping someone could review the code and see if you can tell why it
is stopping here.
Thanks!
Kim

Sub DeleteHeaders()

Dim intCurRow As Integer
Columns("A:A").Select
On Error GoTo jump1:
Do
Cells.Find(What:="STAT", After:=ActiveCell,
LookIn:=xlFormulas, Lookat _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
True, SearchFormat:=False).Activate
intCurRow = ActiveCell.Row
ActiveCell.Range("A1:B10").Select
Selection.EntireRow.Delete
Loop
jump1:

End Sub
 
Thanks Tom,
I deleted that after I found the code but it still seems to be around.
I think the code I used that worked I found in a post you supplied
awhile ago. That's funny.
Thanks!
Kim
 

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