Signup small business forum

How to Create a Simple Macro in Excel

by Yoan 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

{ 159 comments… read them below or add one }

Ajay January 23, 2009 at 4:41 pm

Nice example.

Paul O. Sanchez January 29, 2009 at 4:17 am

I will donate. Please show me how to create a macro that will automatically sort a column. This column will be set up as a vloopup from anothe worksheet. Is that possible? Need your help ASAP. I will pay you.

Ashish Sawant January 29, 2009 at 10:52 am

Hi,

I thought Creating Macro itself is tidious task but bigining is very simple like to go indepth of it
Thank you very much

Kumar January 29, 2009 at 5:30 pm

Quite understandable and easy to learn. In short very helpful..

neesha February 2, 2009 at 4:36 pm

this is very helpful for beginners

it would be great help if u can give some more examples.

Charles February 7, 2009 at 5:29 am

I’ve been using excel for a while, but somehow have never learned how to make a macro. That was the easiest explination i found anywhere. Thanks

Sanjay February 25, 2009 at 5:02 pm

Really simple!!!!

Arindam March 17, 2009 at 7:05 pm

Thanks.It would be nice if you can tell us how to create simple macros using VBA along with the syntax for simple VBA commands.

Rahul March 20, 2009 at 11:19 am

Thanks, this is great.

muthu March 30, 2009 at 12:04 am

hi,

it was very good and clear to understand

Chris April 2, 2009 at 7:49 pm

teach some complex example task dude….

rupali April 3, 2009 at 4:47 pm

good

TheOperative April 8, 2009 at 12:16 am

There are many more example on the way, I am in the process of upgrading the site.

TheTrainer April 23, 2009 at 12:44 pm

great job…

pandurang May 10, 2009 at 3:04 pm

very nice example i want to practice more than this .

manjunath May 12, 2009 at 6:49 pm

thanks dude ………..

please tell me web sites of other tutorial……..

MANJU

rashmi May 15, 2009 at 5:06 pm

hi,

i wants to learn macro..i can create a little bit but how to use it for whole sheet

Vayu May 28, 2009 at 5:09 pm

Excellent example to undestand about marco..thanks

Vayu May 28, 2009 at 5:37 pm

Excellent

Shrikant May 29, 2009 at 1:46 pm

Very good example!! :)

Sasikala June 2, 2009 at 5:01 pm

really it helps me. i got it i got it……..Thanks

parameswaran June 10, 2009 at 5:35 pm

good, very easy learn.
requesting you to give more on macro

Manoj Toshniwal July 2, 2009 at 9:09 am

Very easy way to learn macro.

ruby July 6, 2009 at 10:12 am

good one. i know the basic now

i would like ro learn more
Thanks

Vikram July 6, 2009 at 7:12 pm

This was truly a simple example which covered a lot, especially for a non technical guy like me!!!

pradnya July 7, 2009 at 1:12 pm

this article is good,but in windows Vista and 2007 version of excel,the tools option is not comin,so i m very confused,how to work here.

Satish July 9, 2009 at 1:57 pm

Really nice example

binny July 16, 2009 at 2:33 pm

thanks it helps me alot

Priyanka July 17, 2009 at 1:18 pm

Too easy. It has taken out the fear of macros out of me.

Rajendra Chozhan July 18, 2009 at 5:17 pm

Hi,

It’s very useful for all of them……………..Very Nice to learn easy

Thanks Chozhan………….

ritesh gaikwad July 22, 2009 at 1:05 am

thanks for learn me macrows but we need practical example to how its use full in our job

mehdi July 22, 2009 at 8:20 pm

can i pay you to do a simple macro for me

nadeem July 27, 2009 at 3:04 pm

a macro for when i put list name call 100 item list drop down
please give me a macro to solve this problem

Sushant Singh July 29, 2009 at 5:37 pm

great example to start with

Sravani G August 6, 2009 at 7:15 pm

Thank you man.

Sreedhar August 11, 2009 at 12:35 pm

Excellent example to learn about Macros.

Sreedhar Yamsani August 11, 2009 at 12:38 pm

Nice Example….

Thanks………………… Yamsani

vishal August 18, 2009 at 12:34 pm

Excellent example to learn formula for execl

Asha August 21, 2009 at 7:52 pm

Very good and very simple for the begniers.

Prashanth August 26, 2009 at 5:00 pm

Hey…

Vry Vry nice… Its vry easy and simple to understand for beginners.

Its would be great if you can teach some more complicated macros.

Niharika August 27, 2009 at 1:55 pm

Hi,

I am an HR and have to contantly work with excels. I want to know if i can create macros to pull out data from one excel file to another excel file?

GEORGE August 28, 2009 at 9:21 pm

Please could someone again show me a very simple steps to create macros using excel

Sanji September 7, 2009 at 8:29 am

Great example, using this in our IST class, thank you. XD

ann September 10, 2009 at 8:21 pm

thank u so much….it was very clear to understand. its very nicely explained step by step. thank you..much appreciated.

Aubrey September 17, 2009 at 7:37 am

Very nice example. How do I get more of your tutorials? Of course I willdonate
Thanks
Regards

rajmeet September 21, 2009 at 4:23 pm

Nice example, …………

Neel September 30, 2009 at 11:14 am

thanks nice one

Sudaththa October 8, 2009 at 9:18 am

Thanks. It is very good and clear. Thanks a lot

Sudaththa October 8, 2009 at 9:20 am

Thanks. It is very good and clear. Thanks a lot. One more thing. Also please let us know how to erase a range of cells and copy only the value (not formulas) in to another column with Macros

rajasekar October 9, 2009 at 11:29 am

very nice i can easily got the matter

Leave a Comment

Previous post:

Next post:

Sitemap