How To Call A Macro

Table of contents:

How To Call A Macro
How To Call A Macro

Video: How To Call A Macro

Video: How To Call A Macro
Video: How to call a macro from within a macro in Excel 2024, April
Anonim

A macro is a recorded sequence of commands that can be executed with a single keystroke or by clicking a button. The simplest macro can be created in any office program - Word or Excel to facilitate work with documentation.

How to call a macro
How to call a macro

Necessary

MS Access program

Instructions

Step 1

Choose how you want to run the macro as needed. All of them are divided into two groups: direct and indirect launch. The direct launch of a macro is performed when creating and debugging a macro from the database window. After completing work on it, it is associated with the necessary events, and after that the launch becomes indirect.

Step 2

Open the database window, go to the "Macro" tab, double-click the left mouse button on the required macro. Either select it and press Enter, or click the Run command on the toolbar. To debug the macro, run it from the designer window. To do this, click on the "Start" button.

Step 3

Run the macro using the "Tools" menu, then the "Macro" item and the "Run Macro" command. In the "Run Macro" dialog box that opens, select the desired object from the list, which is contained in the database, and click on the "OK" button.

Step 4

Run the macro indirectly by specifying the macro as the action of a button on the toolbar or a menu item. You can also specify a macro as an event handler. When any event of a form, control or report occurs, the handler associated with this event is launched; a macro can act in its role, which will perform the actions you need. Run a macro from another macro. To do this, when creating it, select the "Repeat Count" argument and "Repeat Condition". This will help you organize your run cycles.

Step 5

Create a predefined macro that runs automatically when you open the database. It's called AutoExec. Or create an AutoKeys macro that can be run by pressing a specific key combination. You can also run a macro from a Visual Basic procedure. To do this, run the DoCmd "Enter the name of the macro" command.

Recommended: