Navigating with Bookmarks

In the process of analyzing or reviewing your VBA procedures, you will often find yourself jumping to certain code areas. Using the built-in bookmark feature, you can easily mark the spots that you want to navigate between.

To set up a bookmark:

1. Click anywhere in the statement that you want to define as a bookmark.

2. Choose Edit | Bookmarks | Toggle Bookmark (or click the Toggle

Bookmark button on the Edit toolbar—see Figure 13-16). Visual Basic will place a blue, rounded rectangle in the left margin beside the statement.

Figure 13-16: You can quickly jump between often-used sections of your procedures using bookmarks.

Once you've set up two or more bookmarks, you can jump between the marked locations of your code by choosing Edit | Bookmarks | Next Bookmark, or simply click the Next Bookmark button on the Edit toolbar. You may also right-click anywhere in the code window and select Next Bookmark from the shortcut menu. To go to the previous bookmark, select Previous Bookmark instead.

You can remove bookmarks at any time by choosing Edit | Bookmarks | Clear All, or click the Clear All Bookmarks button on the Edit toolbar. To remove a single bookmark, click anywhere in the bookmarked statement and choose Edit | Bookmarks | Toggle Bookmark, or click the Toggle Bookmark button on the Edit toolbar.

Was this article helpful?

0 0

Post a comment