How to Create a Simple Macro in Excel
February 23rd, 2007All 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.

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.

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

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.

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.”

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.

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.
47 Comments
Comments RSS TrackBack Identifier URI
Leave a comment
Good demostration with figures and comments. Easy to unsersatnd.
Magnificent,
It works. Very Simple. Helpful.
Before I think Macro is difficult, now very easy.
Thanks then.
Realy easy to understand. Looking froward to more such articles
I have a problem in Excel.
I want to set up a chart which combines a pass word in botton, without protect sheet, it just press botton then the sheet could be used.
Please, train me indetail.
Hope to hear from you soon.
Best regards,
Vorak
Its really very good site which helps us to learn more about Excel… I love excel i cannot stay without working on Excel I am very much thanks for developing the guys who develops the site.
SIMPLE, CLEAR AND HELPFUL. THANK YOU!
hi,
the tutorial is framed well,so that even a child can understand.good
Great effort!! Good to see the pains that have been taken to make it user-friendly and easy-to-understand.
its awesome i am totally new to excel
and am learning it… learning this was very easy… a very clear and easy step by step procedure.. please continue doing such great stuff for people like us
thanks a lot
simple n easy to understand for beginners
Terrific web site created by the web developer and the thinker who has the knowledge of Excel. I hope you will become sucessful in unpcoming events.
Muhammad Umar Farooq
GOOD ONE FOR BEGINNERS.THANKS A LOT.
It is really wonderful and helps to understand easily
Great, good for new beginners, easy to understand and well explained
Greate Help
after this, macro no more sounds threatening !!!
Well, i dont think its good example. i need sometime more detail about macro. any idea?
Its very good simplest example
Good Example. Very simple explanation
It is what we already know, can we have some better examples
Good Tutorial for begginers as it have clear discription with images
it is good …
very good demonstration.
very basics idea of macros.
Spoon Feeding. Wonderfull Explanation, it would be fine if u tell us how to edit the macros, if we need to add some more data in it.
very nice demonstration and easy to understand
Very good exlanation with a suitable example.
This was really helpful.So easy to learn and nicely explained.Very good for the beginners.Thanks.
Very good exlanation with a suitable example.
This is great for the beginners. Very well explained with pictures and descriptions.
Thanks a ton.
Its really good explained and demostration.
Thanks
Thanks
I’ve learned alot more since it is my first time to work with macros thanks alot, its alot more helpful for beginners.
how to write the macro to delete the repeat number in ms-excel.kindly let me know
I WANT TO KNOW MORE ABT MACRO. THANK FOR YOUR TUTORIAL
very god explanation for making the macro
but MORE EXAMPLE CAN BE TAKEN FOR FURTHER GOOD MACRO
THANKS
looking good
well done,
i like the way that u have given with demonstration of macro
Good easy to understand
fantastic.
very good explanation and very useful. simple steps well done
thank you
Very easy learning. How do I handle complex situations. Please guide.
Nice & step wise detail is given to start simple macro. Thanks
very good demonstration.Keep posting more samples
good article for beginners, simple language and good content. Thanks alot
Thanks Much, this is definitely good but then I need some more indepth knowledge on this. How could you help me?
Warm regards,
Debashis
Hi,
This is really helpful for the biginers. Its a nice example for simple macors.
Thanks,
Rajesh
could you pls post the codes that is needed for programming a macro
i need it for my project
and
if its okay to you, pls send me the copy thanks in advance
Good work