Читать книгу Excel VBA Programming For Dummies - Dick Kusleika - Страница 52

Adding a new VBA module

Оглавление

Follow these steps to add a new VBA module to a project:

1 In the VBE, select the project’s name in the Project window.

2 Choose Insert ⇒ Module.

Or

1 Right-click the project’s name.

2 Choose Insert ⇒ Module from the shortcut menu.

When you record a macro, Excel automatically inserts a VBA module to hold the recorded code. Which workbook holds the module for the recorded macro depends on where you chose to store the recorded macro, just before you started recording.

1 Choose File ⇒ Import File or press Ctrl+M.A dialog box appears that asks for a file.

2 Locate the file, and click Open.

You should import modules only if you know the person who exported them. Otherwise, you risk introducing macros that perform malicious actions. If you’re not sure, open it in a text editor to review it first.

Excel VBA Programming For Dummies

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