View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Harold Good Harold Good is offline
external usenet poster
 
Posts: 81
Default why does the execution jump to another procedure?

Hi, I have the following code. As I push F8 to execute manually, after the Insert row, it jumps to another procedure, skips around some of those lines of code, then comes back to execute the last line?

I have noticed this pattern in some other spreadsheet VBA as well.

What am I doing wrong? Thanks, Harold


Private Sub InsertRow()
Dim myRow As Long

myRow = ActiveCell.Row
Do Until Cells(myRow, 2) < Cells(myRow + 1, 2)
myRow = myRow + 1
Loop
Rows(myRow).Insert
Rows(ActiveCell.Row).Select

End Sub