How To Write A Macro

Table of contents:

How To Write A Macro
How To Write A Macro

Video: How To Write A Macro

Video: How To Write A Macro
Video: How to Create Macros in Excel Tutorial 2024, November
Anonim

You can use special programs called macros to convert data to Excel, reformat tables in Word, or make a large number of changes of the same type in Power Point slides. To create such programs, you can use the Microsoft Visual Basic for Applications (VBA) programming language, or simply record a sequence of actions performed. Consider the second option, which does not require knowledge of the VBA language.

How to write a macro
How to write a macro

Instructions

Step 1

Let's say the task is to format a lot of tables in a Word document. From the Tools menu, select Macro and click the Start Recording button.

Step 2

In the window that opens, enter the name of the macro to be created, the keyboard shortcut for quick launch, the disk space where the macro should be saved, and comments describing the operation of the macro.

How to write a macro
How to write a macro

Step 3

After pressing the OK button, a panel with buttons "Stop" and "Pause" will appear. Format one of the tables as needed, for example, you can set the width to 50% of the page width or change the style of the table borders. After all changes to the table have been made, click the "Stop Recording" button.

Step 4

Now select any table in the document and run the macro, the whole sequence of actions done with the first table will be repeated.

Recommended: