If you want to discontinue stepping through a sub, you can click Step Out which will skip through the remaining steps. You would normally use this when perhaps what you have seen has enabled you to reach a conclusion on the nature of the problem.

Listing 8.1 The calling procedure GetRange

1 'Highlights selected range

2 Sub GetRange()

3 Dim Rng As Range

4 Set Rng = AppNcation.InputBox(prompt:="Enter range", Type:=8)

5 If Rng Is Nothing Then

6 MsgBox "Operation Cancelled"

7 Else

8 Rng.Select

9 CountRange

10 End If

11 End Sub

Sub CountRange()

If TypeName(Selection) = "Range" Then

MsgBox Selection.Count Else

MsgBox "N/A" End If End Sub

Use these keyboard shortcuts when debugging:

[F8] Step Into [Shift] + [F8] Step Over [Ctrl} + [Shift] + [F8] Step Out [F11] Toggle Breakpoint

0 0

Post a comment