Macros are my new best friend

Defeating repetitiveness in Microsoft Office

Have you ever had to do something repetitive in Microsoft Office, for example merging cells in a table, and wished that there was an easier way to do it that didn’t involve so much clicking? Wouldn’t it be nice to merge all those cells using a keyboard shortcut? (Keyboard shortcuts are explained in this article.)
If you have replied “YES” to any of these questions, then look no further than this article.

What is a Macro?

A Macro is a single instruction (for example a keyboard shortcut or a button) that expands automatically into a set of instructions to perform a particular task, for example: If you create a Macro which prints the 3rd page of a document only and then assign it to a button, then when you click on the button you will only print page 3 of your document.
Macro’s DO take extra time to set up correctly, BUT you save so much time when you start using them on a regular basis.

The example I will use will merge cells as well as aligning text in a table. When you merge cells in a table, you take two or more cells and you combine them into one big cell.
To merge cells in Microsoft Word, you need to highlight the cells you want to merge and click on Merge Cells, which is found in the Table Tools – Layout tab of the ribbon.

Create a blank document and insert a table into it with 5 columns and 5 rows. Type your name into the first cell of the table. Once you are finished save your document AND highlight the first column of your table.
NB: Make sure you highlight the column BEFORE you start creating the macro.
Look at the picture below for an example.
Macro 1

How do I record a Macro?

Step 1: Enable the Developer tab

In order to record a Macro you first need to have the Developer tab active on your ribbon. The Developer tab is not usually turned on, and it appears next to the View tab.
If you can already see the Developer tab on your ribbon then you can skip this step.
To activate the Developer tab, click on File and then click on Options. Once you have done this click on Customize the ribbon and then put a tick next to the Developer option, as shown in the picture below.

Macro 2

Once you have done this and clicked on OK the Developer tab will now be visible on your ribbon.

Step 2: The Macro dialog box (Record Macro)

You now need to setup your Macro and assign it a keyboard shortcut.
Make sure that you have your document with the table open, your name is in the first cell and you have highlighted the first column BEFORE you launch the macro dialog box.
Click on the Developer tab and then click on Record Macro. A dialog box will open up which is used to configure your macro. You don’t need to change anything in this dialog box, just click on the Keyboard button to open up another dialog box which we will use.

Macro 3

This dialog box is used to choose a keyboard shortcut that you want to use. In the example above I am using CTRL + W as a keyboard shortcut example. You also need to choose where the macro is saved in.
When you create a macro you have an option to save it into all documents (Normal) or to save it in the document that you are working in. In this example I am saving my macro into a document called Macro Example. Click on Assign once you have finished with this dialog box and then close it.

Step 3: Merge the cells and align the text

Once you have clicked on the Assign button, you now need to perform the actions that you want the macro to do. Make sure you do not click anywhere inside your document. You only need to click in the ribbon.
Click on the Table Tools – Layout tab and then click on Merge Cells.

Macro 4

Now align the text in the middle of the new big cell by clicking on the Align Centre button.

Macro 5

Now that you have finished performing all the actions that you want your macro to do, you now need to stop recording your macro and test it. Click on the stop recording button to stop recording your macro.

Macro 6

Step 4: Test your macro

It is now time to test your macro. Type in your surname in the first cell of the second column, highlight the whole column and press the key you chose for your shortcut. If you have followed all the steps correctly then your document should merge all the cells in the second column and align your surname in the middle.

If you want to learn more about Macro’s or Microsoft Word, why not enrol with us for a computer course? We have many different courses available and you can pay in monthly instalments. Click on this link to see what we have on offer!

Similar Posts