Making the macro available

At this point, everything should be working properly. But you still need an easy way to execute the macro. Assign a shortcut key (Ctrl+Shift+C) that executes the ChangeCase macro:

1. Activate the Excel window via Alt+F11.

2. Choose DeveloperOCodeOMacros or press Alt+F8.

3. In the Macros dialog box, select the ChangeCase macro.

4. Click the Options button.

Excel displays its Macro Options dialog box.

5. Enter an uppercase C for the Shortcut key.

See Figure 16-7.

6. Enter a description of the macro in the Description field.

8. Click Cancel when you return to the Macro dialog box.

Figure 16-7:

Assign a shortcut key to execute the Change Case macro.

Macro Options

Macro name:

ChangeCase Shortcut key:

Ctrl+Shift+ C Desmpiion

Change the case of tent in the selected cells.

After you perform this operation, pressing Ctrl+Shift+C executes the ChangeCase macro, which displays the UserForm if a range is selected.

0 0

Post a comment