Excel Macros: Excel VBA Macros Tutorial for Beginners

Excel VBA-asKeygeek
Table of Contents

Excel Macros or VBA Tutorial for Beginners (with Images)

This Introductory post/tutorial is for beginners who want to learn the basics of Excel Macros !

Before getting started with excel macros just two lines about Macros and VBA.

  • What is a Macro?

    – A macro is a series of VBA commands and functions to perform a task.

  • What is VBA?

    – VBA (Visual Basic for Applications) is a programming language that Microsoft Office (MS Excel, Word, Power Point, Access etc) applications uses.

An excel macro is a set of VBA commands and functions that automates the tasks you do in excel.

Set of VBA instructions = Macro = Automated task

The best part is you don’t have to know anything about VB or VBA to automate a task you do in excel or to create excel macros.

It is as simple as using a voice recorder in your mobile phone.

Click on start + record the task + click on stop = it’s done! Your macro is created!

Why don’t you try creating your first Excel Macro?

Let’s create a macro which fills Green color in your Excel cells.  Follow the below steps.

Steps to create your first macro:

Step 1: Open a new Excel and go to the Developer tab then click on Record Macro from the Code section.

MacroPin

Step2: As soon as you click on Record Macro a pop-up window appears requesting you the following:




Macro name    : GoGreen (Lets name our macro as GoGreen; Remember not to use any special characters or space.)

Shortcut key    : For now lets leave it as blank.

Store Macro in : This gives you three options to save the macro in; current work book, Personal
Macro Workbook or in New Workbook. Let’s select the current workbook ie.‘This Workbook’    

Description      : My first macro to fill Green color in cells. (A small description about the
macro you are creating.)

After filling the details click OK.

MacroPin

As soon as you click OK, the Record Macro’s icon turns to a blue button and the same is visible at the bottom of the screen and that indicates macro has started recording; means from now what ever you do in excel will get recorded. This blue button is our Start and Stop button.(Even we can directly start recording macro by clicking this button rather than going to Developer tab and then Record Macro.)

Macro

Step3: Go to Home tab and click on Fill Color and from the list of colors displayed click on Green.

MacroPin

Step4: Click on Stop button (The Blue button mentioned above) to stop recording macro.

Now that you have recorded your first macro and you can run it by clicking Developer tab – Macros- Run OR Alt + F8 – Run. But wait a minute lets make it little more beautiful and convenient to use.
Go to Insert – Shapes and click on any shape which you like (I have selected Rectangle). Now your courser turns to a ‘ + ‘ shape that means you can draw a Rectangle in any part of your Excel.

MacroPin

After you draw a Rectangle, right click on it and click on Edit Text and name your shape as GoGreen. And once again right click on the shape and then click on Assign Macro..from the drop-down list.

MacroPin

After you click on Assign Macro, a pop-up window appears then select GoGreen from the Macro name filed and click OK.

MacroPin

You have successfully created your first macro and assigned a button to run that macro, start filling green color by clicking the GoGreen button.

MacroPin

Now that we have to learn how does this macro works. We will learn it from the next chapters. Before that two quick home works:

1. Open VBA editor and try to explore/understand the GoGreen Macro codings by yourself.(Developer tab – Macros – GoGreen – Edit)
2. Record another macro to NoFill the entire sheet and assign that macro to a different shape and name it as Clear all. So thatyou can keep playing with your macro; One to fill the color and another to clear the color.
You can download my free GoGreen Macro Workbook from the below link.

Download Free Macro Workbook

Download Free Excel Macros

Automate Complex Tasks with Microsoft Excel VBA & Excel Macros (Real-World Projects included). Achieve More. Save time.

t will be a worth investment! And Right Now you can register with upto  80% Off 
(Only when you click and join from here ⇊)

Unlock Excel VBA and Excel Macros

Anson Antony
Anson Antony
Anson is a contributing author and founder at www.askeygeek.com. Learning anything new has always been his passion, askeygeek.com is an outcome of his passion for technology and business. He has got a decade of versatile experience in Business Process Outsourcing, Finance & Accounting, Information Technology, Operational Excellence & Business Intelligence. During the tenure, he had worked for organizations like Genpact, Hewlett Packard, M*Modal and Capgemini in various roles and responsibilities. Outside business and technology, he is a movie buff who spends hours together watching and learning Cinema and a Film Maker too!

16 Responses

  1. Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your webpage? My website is in the exact same area of interest as yours and my users would certainly benefit from a lot of the information you provide here. Please let me know if this alright with you. Thanks a lot!

  2. Great post, I conceive website owners should learn a lot from this weblog its rattling user genial . “Frisbeetarianism is the belief that when you die, your soul goes up on the roof and gets stuck.” by George Carlin.

  3. Merely wanna remark on few general things, The website design is perfect, the subject material is really superb : D.

  4. Found your short article quite interesting without a doubt. I really experienced reading through it and you also make fairly some very good factors. I’ll bookmark this web page for the potential! Relly excellent short article.

  5. Found your article quite intriguing in truth. I really loved examining it and you simply make quite some great points. I’ll bookmark this web site with the long term! Relly good write-up.

  6. I simply want to mention I’m very new to blogs and really savored your web page. Probably I’m want to bookmark your blog post . You definitely come with fabulous article content. Appreciate it for revealing your blog.

  7. Excellent post at Introduction to Excel Macros |. I was checking constantly this blog and I’m impressed! Extremely useful information specially the last part 🙂 I care for such information a lot. I was looking for this certain info for a very long time. Thank you and best of luck.

Leave a Reply to banget Cancel reply

Your email address will not be published. Required fields are marked *

Congratulations!
You Made It,
Don't Close!
Enter your chance to win 100,000 UberTTS Character Credits
Thank you for your visit!

This popup won’t show up to you again!!!

UberTTS 100K Easter Egg
Share to...