Читать книгу Excel Macros For Dummies - Dick Kusleika - Страница 29

Building navigation buttons

Оглавление

One common use of macros is navigation. Workbooks that have many worksheets or tabs can be frustrating to navigate. To help your users, you can create some sort of a switchboard, similar to the one shown in Figure 1-10. When a user clicks the Example 1 button, he’s taken to the Example 1 sheet.

Creating a macro to navigate to a sheet is quite simple.

1 Start at the sheet that will become your switchboard or starting point.

2 Start recording a macro.

3 While recording, click the destination sheet (the sheet this macro will navigate to).

4 After you click in the destination sheet, stop recording the macro.

5 Assign the macro to a button.


FIGURE 1-10: Use macros to build buttons that help users navigate your reports.

It’s useful to know that Excel has a built-in hyperlink feature, allowing you to convert the contents of a cell into a hyperlink that links to another location. That location can be a separate Excel workbook, a website, or even another tab in the current workbook. Although using a hyperlink may be easier than setting up a macro, you can’t apply a hyperlink to form controls (such as buttons). Instead of a button, you’d use text to let users know where they’ll go when they click the link.

Excel Macros For Dummies

Подняться наверх