Instructions on how to create and use macros in Excel Create macros, save macros, run macros

Instructions on how to create and use macros in Excel Create macros, save macros, run macros. Creating a simple macro will make it easier for you to understand and from there you will learn more advanced with macros in Excel. If you want to know how to create, save and run macros in

Beginners learn about macros in Excel, creating a simple macro will make it easier for you to understand and from there you will learn more advanced with macros in Excel. If you want to know how to create, save and run macros in Excel, please refer to the example of creating a simple macro that the article below shares.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 1Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 1

Below the article guides you how to create and use macros, save macros in Excel, invite you to follow along.

First, if your Excel file does not display the Developer tab, then display the Developer tab on the Ribbon as follows:

1. Select File -> Options.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 2Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 2

2. In the Excel Options window, select Customize Ribbons , then check the box in the box before Developer and click OK .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 3Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 3

Method 1: Create a Macro using the Record Macro

Step 1 : In Excel file, select the cell to perform the operations, next select Developer -> Record Macro .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 4Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 4

Step 2: Appears a Record Macro table, enter the name of your macro in the Macro name (write without spaces), you can also describe your macro in the Description section . You can also set shortcuts in the Shortcut key box . Then click OK to start recording operations in Excel.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 5Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 5

Step 3: You start to perform the operations you want to create macros, for example, you perform some alignment operations such as center alignment, bold printing, coloring, and background shading for text.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 6Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 6

Step 4: After you finish manipulating and want to stop recording macros, you select the Developer tab -> Stop Recording.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 7Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 7

So you've created the simple Macro already, if you want to create other macros, then you do the same.

Step 5: Use the created macro.

Select a cell in Excel where you need to use macros, then select the Developer -> Macros tab .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 8Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 8

The Macro dialog box appears, select the macro name you want to use and select Run to run the macro.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 9Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 9

So immediately the data box you choose will be performing the manipulation of macros that you manipulated during macro creation.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 10Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 10

Method 2: Create Macros using Visual Basic code

Step 1: Select Developer -> Macros or press Alt + F8.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 11Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 11

Step 2 : The Macro dialog box appears , enter a name for the macro in the Macro name section (write immediately, without accents) and click Create .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 12Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 12

Step 3 : In Sub sub tenmacro () . End Sub you write Visual Basic code, if you do not know the code you can search for suitable code online, then copy and paste the code into the middle of the section Sub . End This sub . Then close the Visual Basic window.

For example, there is a simple code below to help you italicize and fill in a red background.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 13Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 13

Step 4: Use the Macro

You can use macros similar to the way above is to select the cell to run the Macro and click Developer -> Macros tab .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 14Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 14

The Macro dialog box appears, select the macro name to use and select Run .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 15Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 15

So the macro will run and execute exactly the code that Visual Basic you enter.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 16Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 16

Step 5: Set up keyboard shortcuts to use macros.

If at the time of creating macros, but you have not set a shortcut, you can set the shortcut again by in the Macro dialog box, select the macro name to set the shortcut and select Options .

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 17Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 17

Macro Options appears , enter the characters in the white box next to Ctrl and click OK to save the shortcut.

Note: you must not enter the numeric keys but only the characters.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 18Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 18

So instead of having to choose Macros -> Macro name -> Run , you can use the shortcut you just set to use macros.

Step 6: Save the Macro

Select File -> Save As ( F12 key ). The Save As window appears, select a location to save the file, name the file, then in the Save as type section, select Excel Macro-Enabled Workbook and select Save to save the Excel file and macro.

Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 19Instructions on how to create and use macros in Excel Create macros, save macros, run macros Picture 19

So you know how to create and use macros in Excel and how to save macros in Excel. To know how to turn on, turn off, delete macros in Excel, you can refer to the article How to turn on, turn off, delete macros in Excel.

If you know how to use macros proficiently, you will work with Excel faster, greatly reducing Excel processing time. Good luck!

3.5 ★ | 2 Vote