How to Make Simple Macros in Excel

bardimin pic

Written by Bardimin

On December 29, 2021
Home » Blogs » Software » How to Make Simple Macros in Excel

If you're working with , you're often doing repetitive work. Doing the same job repeatedly, of course, is very tedious and tiring if there are a lot of them.

To do this work, you can use the Macros in . The will record all your actions from clicks and keystrokes. You can also edit the to suit your needs.

Showing Macro

Macro and VBA tools can be found on the Developer tab, which is hidden by default, so the first step is to enable them.

On the File tab, select Options > Customize Ribbon.

record macro 01

Then you can find the Macro tool on the Developer tab.

record macro 02

Recording Macro

  1. On the Developer tab, click the “Record Macro” button
record macro 03
  1. Then do the work you want to automate, such as setting cell formats, fonts and others.
  2. When finished, click the “Stop Recording” button
record macro 04

Creating a simple Macro to set cell format

In this sample macro, we will create a macro to give a border, set the font size and style.

  1. Create sample data in Excel and select the data that you set the format for, for example as follows
record macro 05
  1. Then you click the “Record Macro” button. In the window that appears, you can give the name of the Macro that you created and can also add a Shortcut for easy access . You need to pay attention when creating shortcuts, do not use shortcuts that have been used by Excel or . Click the “OK” button to start recording.
record macro 06
  1. Do the work you are going to record. In this example we will create a border on the cell that we selected, then change the font size and style, and also set the number format.
record macro 07

Click the “Stop Recording” button, if you have finished doing the work and stop the recording process from the macro.

  1. To edit and view the Macros that you have created, you can do so by clicking the “Macros” button and then selecting the macros in the list. Then click the “Edit” button to make the necessary changes or view the generated VBA code.
record macro 08

You can make changes to the VBA code that is formed according to your needs.

record macro 09
  1. To run the macro that we have created, select the cells that you want to format. Then open Macro and click “Run” to run the macro.
record macro 10
  1. To save an Excel file with Macros, you must save it in the “. xlsm ”
record macro 11

Thank you for visiting Bardimin. Thank you…..

Latest Articles

How to Sum Number Columns and Rows in a Microsoft Word Table

How to Sum Number Columns and Rows in a Microsoft Word Table

Microsoft Word is known as a popular program for editing documents, but did you know that you can also perform calculations in Word? One of the biggest challenges faced during the manual data entry process is the possibility of errors in performing numerical...

Redirect and Block URLs with HOSTS File on Windows

Redirect and Block URLs with HOSTS File on Windows

Redirect and Block URLs you can easily on Windows. Just by adding the IP of a website, you can redirect or block it. Of course, this is very useful to limit the access of your employees or children from accessing websites that you do not allow. Your Windows PC has...

Repeating and Keeping Table Headings on Each Page in Microsoft Word

Repeating and Keeping Table Headings on Each Page in Microsoft Word

Using tables is one efficient and organized way to display data in rows and columns. Good table formatting will make the table visually appealing. If you often work with Microsoft Word documents, chances are you need to periodically use tables when recording data. In...

How to Bypass Forgotten BIOS Password

How to Bypass Forgotten BIOS Password

If you have created a BIOS password for your PC/Laptop and forgot it, you may have to send it back to the manufacturer. Don't worry, there are still several methods you can use to bypass or unlock the BIOS password. The BIOS password serves as a form of authentication...

Basic Computer and Laptop Maintenance Techniques

Basic Computer and Laptop Maintenance Techniques

You may not realize it, but computers and cars have something in common, both requiring regular maintenance. If your car needs regular oil changes, your computer should also regularly update its software, keep its antivirus up to date, and check for spyware....