How to Create a Simple Macro in Excel

by Joanna on February 23, 2007

All jobs and fields require some repetitive steps. Even the most creative jobs can usually require some monotonous tasks. Tools like Excel can help us automate some of those repetitive steps and that way makes our lives easier, so we can get the work done quickly and have more leisure time. In essence that is what Macros do; they’re shortcuts for repetitive tasks done within Excel. In this tutorial, I will show you how to create a simple macro that will memorize the steps involved in a simple repetitive task. We are going to be using fictitious information for the Training Department in a restaurant chain company called Happy Tummies. This company has restaurants in five major cities, so a great deal of training is done all year round. All restaurants are assigned a Training Manager, there are five Training Mangers in total. We’ll pretend you are the Training Specialist who works out of the Corporate Office located in Miami, FL and are responsible for analyzing and preparing reports on all the trainings completed. One repetitive task that you always perform is entering the names of all the Training Managers to prepare the daily training reports.

Let’s Get Started!

1. Go to Start>Programs>Microsoft office>Microsoft Excel to open the application. Then, go to Start>New to open a new spreadsheet. Go to File>Save as and save the new file before going further so you don’t loose any work.

macro screenshot 1

Please Note: Macros require you to set a security level of low, medium or high. For the purposes of this tutorial, which is just to show you the simple basic steps to creating a macro, we are going to set the security level to medium since a security level of high will restrict the use of the macro.

2. Go to Tools>Macro>Security, and a pop up window named “Security” will appear. Select the Medium option under the Security Level tab and click OK to continue.

macro screenshot 2

3. Go to Tools>Macro>Record New Macro.

macro screenshot 3

4. A pop up window named “Record Macro” will appear. Here you will n
need to enter a name for the macro under “Macro Name”, I’m calling this macro “ht” (the initials of the company, Happy Tummies). Please note that the first character of the macro name should be a letter, then you can use any letter, number or underscore but with no spaces. Then, enter a symbol from the keyboard under “shortcut key” to be used as a shortcut to activate the macro, I’m entering “h” since it is the initial of the company’s name. Then, you need to select the placement of the macro under “Store macro in:” - I’m saving this macro in the “Personal Macro Workbook” so that it is available when you create new spreadsheets and want to use the macro. Finally, enter a brief description of the macro under “Description” and click OK to continue.

macro screenshot 4

5. In this step, you will record the macro. You will see a tiny pop up window that will appear with a blue button , you can press this blue button at any time to stop recording the steps for the macro. Now, enter the five names of the training managers starting under column A, row 1 The names are: Mary Smith, Thomas Spicler, Morgan Lopez, Samantha Davies and Nike Temples. Once you are done entering all five names, click the blue button to stop recording the new macro. You are done recording the macro, but please remember that they keyboard shortcut for this macro is Control Key + h, and that you saved the macro in your “personal macro workbook.”

macro screenshot 5

6. In this step will test that the “ht” macro works. Go to File>New to open a new spreadsheet. Then, press the Control key and “H” key at the same to activate the macro. You will see that the names of the five Training Managers have appeared under column A. Please note that you can also go to Tools>Macro>Macros and select this macro from the “Personal Macro Workbook” to run it.
macro screenshot 6

Well Done! You’ve learned some quick simple steps that will help you create macros. But, do keep in mind that macros can be more complex and powerful; so the more you learn about them and practice using them, the better you will get. I will you show more complex functionalities of macros in other separate tutorials.

If this tutorial has helped you, please consider donating.

{ 2 trackbacks }

How to Edit a Macro Using Microsoft Visual Basic in Excel
October 26, 2009 at 6:49 pm
How to Create a Toolbar Button for an Existing Macro
October 26, 2009 at 6:55 pm

{ 131 comments… read them below or add one }

Raj October 16, 2009 at 9:11 am

Thank u SO MUCH , I am not aware of macros , you have explained it clearly as a laymans theory

Paul October 20, 2009 at 12:54 am

clear explanation

CHEBAB October 20, 2009 at 10:39 pm

you have showed us a good cleverness that it’s interesting our-self
thank you.

CHEBAB October 20, 2009 at 10:43 pm

you have shown us that good tip appears interesting

CHEBAB October 20, 2009 at 10:44 pm

I’m not good in english so if there is one how can help me for that.

CHEBAB October 20, 2009 at 10:45 pm

I’m not good in english so if there is one who can help me for that.

CHEBAB October 20, 2009 at 10:47 pm

finally a have wrote a good sentence on your comment list…. Iim still waiting please

Al October 22, 2009 at 3:32 pm

Chenab : what language do you speak in ?

Jyoti October 27, 2009 at 2:34 pm

It has been explained in real simple manner. Great!

shakil Ahmad November 4, 2009 at 1:32 pm

Fantastic yaar, veryvery clear discription, nice explanation of each steps
thnks alot

Naren November 6, 2009 at 10:06 pm

Please tell me how to take out percentage and solve divison?
Thanks
Nanre

suman November 7, 2009 at 6:15 pm

Thnks for your clear cut explanation…

VINAY KUMAR November 16, 2009 at 8:48 pm

i didn’t knew that it’s so simple to learn…

k.venu gopala rao November 17, 2009 at 11:24 pm

thanks for you simple procedure to know about a macro.

Ursula Wilson November 21, 2009 at 8:49 pm

Fantastic, I found the explanation to be quite clear and logical. I will want to see a more complex Macro being done.
Thanks a million.

Suresh Jetty November 24, 2009 at 4:33 pm

Good one for beginners, such kind of macros can also be found in couple of automated tools and database GUIs like PL/SQL Developer tool, an interface for Oracle Database from All Round Automations..

It could be great if any one can post how to use buttons, control videos in Excel..

Thank you..

hemalalli November 25, 2009 at 1:22 pm

Good example , Thank you

jitesh December 12, 2009 at 12:22 am

pls create the above steps keeping in mind that the user may use the office 2007 .

shaunaq December 21, 2009 at 8:43 pm

I really loved this Tutorial of your and has hlped me alot

THNK U SOO MUCH
It was really gr8

Dharani kumar N December 26, 2009 at 12:21 pm

Good and very easy to understand, I need to learn macros in depth like using VBA, please help me
Thanks & Regards,
Dharani

Subhash Jha December 26, 2009 at 9:09 pm

Really it was very good illustration for beginers to understand each step, I need to learn macros in depth like using VBA,

Please help me

Thanks in advance…

vini December 30, 2009 at 5:41 pm

it was so easy to learn and thanks a lot for making us feel that macro in excel is very easy… please tell us how to create some comple macros … thanks again

monali January 9, 2010 at 1:53 am

thnku so much buddy..its very easy to learn and written in avery simple language..thnx a lot..

Nithya Rajendran January 21, 2010 at 10:33 pm

Its niece article to learn about Macros
Nithya Rajendran

Bhargav January 29, 2010 at 5:12 pm

Good Job

chowdary February 4, 2010 at 11:41 am

this is a very easy process to learn quickly and to under stand the process of macro .thank u very much.

Dhananjay February 8, 2010 at 5:59 pm

Thankyou, You made my work easy ,

Sachin Godage February 13, 2010 at 6:37 pm

Gooooood it’s very usefull

Prabu February 16, 2010 at 6:40 pm

For this example very easy to understand.

Thankyou for this Site.

Regards……
P.Prabu

swapnil chavan March 5, 2010 at 4:55 pm

I have learned very simple procedure to create a macro

Mahesh March 7, 2010 at 3:46 pm

Good Basic Learning

Leave a Comment

Previous post: How to Easily use the Autofilter and Advanced Filter Functions in Excel

Next post: How to Create a Simple What If Scenario in Excel

Sitemap