Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Jeff Cunningham   on Dec 12 In MS Office Category.

  
Question Answered By: Velma Adams   on Dec 12

Let's discuss debugging for a moment: Pascal's code is given again below
for discussion purposes.

Sub blah()
Do While ActiveCell <> ""
If ActiveCell = "TRNS" Then
Selection.EntireRow.Insert Shift:=xlDown Selection.EntireRow.Insert
Shift:=xlDown ActiveCell = "ENDTRNS"
ActiveCell.Offset(2, 0).Select
End If
ActiveCell.Offset(1, 0).Select
Loop
End Sub

Get Excel and the VBE side by side on one screen (even better if you
have two monitors), and step through the code execution with F8. If you
do not know how to do this, select an appropriate cell in Excel for the
code to start, position your position your cursor anywhere in the
routine Blah(), and then press F8. Now, you can watch what Excel does
during each step of the code execution.

Pascal's code works like it should on my machine. Let us know the
debugging results.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Help with Loops Or get search suggestion and latest updates.


Tagged: