How do I run macros in Excel?

Source: Internet
Author: User

You can run macros in several ways. You can always run macros by using the menu commands. You can also run a macro by pressing the Ctrl key, clicking a toolbar button, or clicking an area on an object, graphic, or control, depending on how the macro is run. In addition, you can run macros automatically when you open the workbook. There is a small problem in the running macro process, I do not know if you have encountered.

Description: There are written macros to run, always prompted not to, reduce the level of security or prompted to change some software parameters, is not running a macro really troublesome, how to do AH

Solution steps:

1, tools-macros-record a new macro, the dialog box appears, set the shortcut button (edit area will appear a small toolbar, first regardless of it)

2, if you want to new macro is a regular use of the page settings, then the usual Settings page to operate, when the page is set up, press the toolbar just appeared in the editing area of the Stop button.

3, when you create a new document to page settings, just press the original set of the shortcut button to complete the operation.

Note: If you set the macro security level in Microsoft Office Excel to disable all macros and do not notify, Excel will run only those macros that have a digital signature or are stored in a trusted location, such as the Excel Startup folder. If the macro you want to run is not digitally signed or is not in a trusted location, you can temporarily change the security level that enables all macros.

Run macros

If the Development Tools tab is not available, do the following to display this tab:

1. Click the Office button

, and then click Excel Options.

2. In the common category, under preferences for using Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

Note: The Ribbon is a component of the Microsoft Office Fluent user interface.

Two, temporarily set the security level to enable all macros, do the following:

1. On the Development Tools tab, in the code group, click Macro Security.

2. In the macro Settings category, under Macro Settings, click Enable all macros (not recommended, potentially dangerous code may run), and then click OK.

Note: To help prevent potentially dangerous code from running, we recommend that you restore any settings that disable all macros after you have finished using macros.

①. Please open the workbook that contains the macro.

②. On the Development Tools tab, in the code group, click Macros.

③. In the Macro name box, click the macro you want to run.

④. Do one of the following:

To run a macro in an Excel workbook, click Run.

Tip: You can also press CTRL+F8 to run the macro, pressing ESC to break the execution of the macro.

To run a macro from a Microsoft Visual Basic module, click Edit, and then on the Run menu, click Run Sub/user form

, or press F5.

To run a macro by pressing the Ctrl key combination shortcut

1. If the Development Tools tab is not available, do the following to display this tab:

①. Click the Office button

, and then click Excel Options.

②. In the standard category, under preferences for using Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

Note: The Ribbon is a component of the Microsoft Office Fluent user interface.

2. On the Development Tools tab, in the code group, click Macros.

3. In the Macro name box, click the macro that you want to assign to the Ctrl key combination shortcut.

4. Click Options.

5. In the shortcut key box, type any lowercase letters or uppercase letters that you want to use.

Note: When the workbook that contains the macro is open, the shortcut key overrides any equivalent default Excel shortcut keys.

6. In the Description box, type a description of the macro.

7. Click OK, and then click Cancel.

Run a macro by clicking the button on the Quick Access Toolbar

1. Click the Office button

, and then click Excel Options.

2. Click Customize, and then in the Select commands from list, select Macros.

3. In the list, click the macro that you created, and then click Add.

4. To change the macro's button image, select the macro in the box where you added the macro, and then click Modify.

5. Under Symbols, click the button image you want to use.

6. To change the name of the macro that appears when you rest the pointer on the button, type the name you want to use in the Display Name box.

7. At this point, click OK to add the macro button to the Quick Access Toolbar.

8. On the Quick Access Toolbar, click the Macro button.

Run a macro by clicking an area on a drawing object

1. On the worksheet, select an existing drawing object, such as a picture, clip art, shape, or SmartArt.

2. To create a hotspot on an existing object, on the Insert tab, in the Illustrations group, click Shapes, select the shape you want to use, and then draw the shape on the existing object.

3. Right-click the hotspot that you created, and then on the shortcut menu, click Specify Macros.

4. Do one of the following:

To assign an existing macro to a drawing object, double-click the macro or enter the name of the macro in the Macro name box.

To record a new macro to assign it to the selected drawing object, click Record. When you finish recording the macro, click Stop Recording

(in the code group on the Development Tools tab). Tip: You can also click Stop Recording on the left side of the status bar

To edit an existing macro, click the name of the macro in the Macro name box, and then click Edit.

5. Click OK.

6. In the worksheet, select a hotspot.

Tip: This displays the draw tool and adds the Format tab.

7. On the Format tab, in the Shape Styles group, do the following:

Click the arrow next to Shape Fill, and then click No Fill.

Click the arrow next to Shape outline, and then click No outline.

Run macros automatically when you open a workbook

If you record a macro and save it with the name "Auto_Open," it will run every time you open the workbook that contains the macro. Another way to run macros automatically when you open a workbook is to use the Visual Basic Editor to write the Microsoft Visual Basic for Applications (VBA) procedure in the Open event of the workbook. The Open event is a built-in workbook event that runs its own macro code each time you open the workbook.

Create a Auto_Open macro

Create a VBA procedure for the Open event of a workbook

Note : More wonderful tutorials Please pay attention to the triple computer Tutorials section, triple Office group: 185219299 welcome you to join

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.