LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default code break

I have some code which tests for a condition and deletes unwanted rows:

For i = 2 To intLastRow

strCellText = ActiveCell.Text
intLocInStr = InStr(1, strCellText, "sample text", vbTextCompare)

If intLocInStr 0 Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.EntireRow.Delete
intLocInStr = 0
End If

strCellText = ""

Next i

Sometimes, after the ActiveCell.EntireRow.Delete line, the code breaks as if
I had pressed ctrl-Break. I get the message "Code execution has been
interrupted" with options to End, Debug, etc.

I don't have breakpoints or anything. Has anyone ever had this problem or
know why my code keeps breaking? (It's pretty annoying to have to sit there
and keep pressing C ... for Continue.)




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Page Break Adjustments causes a page break each cell BKaufman Excel Worksheet Functions 2 September 10th 10 05:02 AM
Break a link between workbooks when there is no "break" option FruitNLoops Excel Discussion (Misc queries) 2 January 31st 09 05:16 AM
Break cell into multiple lines by line break Chia Excel Discussion (Misc queries) 1 August 20th 06 06:37 AM
code break message box freekrill Excel Discussion (Misc queries) 2 November 29th 05 05:26 PM
adding a new page break to an existing page break Edward Letendre Excel Discussion (Misc queries) 1 March 6th 05 09:29 AM


All times are GMT +1. The time now is 06:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"