Excel Macro Tutorial : What is Excel Macro ?

October 11, 2011| Posted by : | Filled in New to Excel Macro ?

Dear Beginner,

In this Excel Macros Tutorial, you are going to learn the Basics of Excel Macro. This is the first Article of this Tutorial so Let’s begin with What is Excel Macro

What is Excel Macro ?

Macro is really great tool. It allows you to perform multiple operations just by clicking a simple button or changing a cell value or opening a workbook etc. It enables you to work in a smart and efficient way. In terms of productivity, it is very productive as it reduces lots of manual work and gets the things done very fast.

Where do you find Macro?

Macro is very popular software available with the most of the windows applications. Many of the windows applications provide inbuilt Macro programming. For example: Excel, Word etc. In this tutorial, I will be taking example of MS Excel and will be exploring each and every possible technique to do the things in a very easy manner.

In MS Excel, we have both recording and writing our own macros based on our need. We will start with Macro recording.

How to Record Macro in excel

In this section you will learn, how to Record Macro in Excel. Follow the below Steps one by one to record macros in Excel:

1. Open one excel workbook. (Taken example of MS Excel 2010)
2. Go to “Developer” Tab of the workbook. (How to add Developer Tab in Excel-2010 and 2007 Workbook)
3. Click on “Record Macro” button in the right hand side of the Top Menu Bar

4. In Excel 2007 and 2010, Macro recording can be started by clicking on the Red Shape button marked in the bottom bar of the Excel in left hand side.

5. Click on Record Macro Button shown above

6. In the above dialog box, enter the suitable name for this Macro. You can also specify the shortcut key for running this particular recorded macro. It means on pressing that particular shortcut-key, this macro will automatically run.

7. You can give the location, where you want to store this particular macro and also you can write some description about this particular to be recorded Macro.

8. Now click OK and do some operation on the excel sheet. Like formatting of the cell or sorting some of the values etc. and click on the Stop button at the same place when you started running the Macro.

9. I have done the above formatting and wrote few column names while recording.
10. To view this particular recorded macro, right click on any of the Sheet Name -> View Code
11. In left hand side pane, under VBA Project of that workbook, Expand the Module
12. One Module would have been created there “Module 1”. Click on this
13. You can see the recorded code with the given Macro Name.

How to Run Macro in Excel

You can Run this Recorded Macro in two ways: 1. By Pressing Run Button 2. By Pressing Alt+F8

14. To run this Macro, I have deleted the formatting done during the recording of this macro. Now once I will run this Macro, then automatically that formatting will be done in that Sheet. 


15.Now Click on the Run Button to Run the Written Macro.


16.Click on Run


17.After running the Macro, See the Result.


If you Do not want to run the Macro, by Pressing the Run Button in VBE, then follow the below Steps:

1. Press Alt + F8
2. Select Your Macro from the Drop Down
3. Click on Run

To Check out more Excel Macro Tutorials, visit Excel Macro Tutorial

43 Responses to “Excel Macro Tutorial : What is Excel Macro ?”

  1. Nisar Aboobacker says:

    hi Dear Vishwamitra Mishra.
    really nice work, and I get a promotion due to your work
    thanks a lot.

  2. sadham says:


  3. silu says:

    Hi Mishra,

    i’m a beginner and wanna learn macro upto depth. I tried 2 subscriber but its not happening, can u please send me the e book.

  4. @khan says:

    once i save the file and close it the module is not there,what shud be done if one wants to run the micro not in currnet time but after saving it and stuff.I hope u got my question.

    • Vishwamitra Mishra Vishwamitra Mishra says:

      Hi Mr. Khan,

      It looks like while saving you must be getting a pop message like “do you want to save your file as a Macro-free Workbook” and if you say “Yes” then you will loose all VBA code written in a Module. On such message you say “No” and save your file as “.xlsm”. Hope this helps.

    • Ajith says:

      Thanks,for your consideration,,that is very helpfull for me,becouse i haven’t eny idea about macro ,but after follow up this E-book,,it helped me,,,thanks lot ,,again…so,,if you have any new tutorials regarding macro please mail link…

  5. christilda nalatham says:

    Hi Vishwa,

    you have any book or CD or all these things. because i am a beginner and i need to work on Macros for 1 year.. But i dont no anything about it.. Can you please help me

  6. Marl Jins says:

    Hey, I have noticed that occasionally this site shows a 403 server error. I figured you would be keen to know. All the best

  7. Abhijit says:

    Very easy and useful. It helps me alot. Thanks.

  8. […] while recording it.   Step 1.Launch Record Macro Dialog Box as show in the picture below. Click to know how to record a macro     Step 2. Enter your Shortcut Key which ever you like it in the Shortcut Key box as […]

  9. Feni says:

    Hi.. U r doing a great job..I just want u to help me in inserting a photo/picture in my userform for each user..

  10. shalini says:

    It was reallly very helpful.

    Thanks for sharing.

  11. Hey its really cool website and really helpful for New People to learn Excel macro. I want to add your site on my amzingreviewz com . Please allow me to add u r site in my list


    amazingreviewz team

  12. manthan thakkar says:

    kindly learn me more macro demo

  13. sandy says:

    my macro is not running it's shows the error…

  14. Jeena says:

    I have a master sheet which have information of 10 of my employee and their task status in detail.

    i need to run a macro which will identify these 10 employee and create new sheet as per there name.

    which i have done with my below code:


    Sub MAIN()

    Dim MyCell As Range, MyRange As Range

    Set MyRange = Sheets("Sheet1").Range("B2:B16")

    Set MyRange = Range(MyRange, MyRange.End(xlDown))

    For Each MyCell In MyRange

    Sheets.Add after:=Sheets(Sheets.Count) 'creates a new worksheet

    Sheets(Sheets.Count).Name = MyCell.Value ' renames the new worksheet

    Next MyCell

    End Sub


    now what i need to do is extra the rows with the employee name and put the row into the new sheet as per their name.

  15. sheta says:

    hai…i am a chemical engineer student..my lecturer give me assignment..where..user have to key in the x value..and the macro would provide the y value…its like an equation with x variable in it ..to give the y value to the user..can i know how to do it?? thanks..

  16. nagaraja says:

    hi I want to learn macro in excel kindly let me know how to work on macro

  17. Yogisha says:

    Hi Vishwa,

    This is Yogisha.M you are doing wonder full job thank you for your suggestion, and I need one Branch Dash Board template (including all Parameters). Please help me on this.

  18. Prabhu says:

    Hi Vishwa,

    I need to learn Excel macro cording,can you please help on this regards just give me small cordings with examples.I iknow recording I want to go to next step.

  19. Kumar says:

    I would like to set up a macro in a workbook which automatically saves/closes the workbook after a specific period of time.

    For example….if its idle for 5 mins without any activity it should give alert msg and close the excel file.

    The trick is, the macro should only run if there has been no activity/changes to the workbook in that period of time.

    If a workbook is accidently left open on a computer, this will close it automatically.

    I have been searching for info on how to do this, and need help. Any advice is appreciated.

    I am novice so step by step with programming will work for me…

  20. clinta says:

    chanceless vishwa helps me a lot as a new to excel i need to learn a lot need ur help:(

  21. Mahesh says:

    Hi Viswa,

    just like the above task i have to copy certain columns from a excel document and create a new excel document with help of a macro.Please help me with this



  22. Yogesh says:

    good work man!!!!!!!

  23. Mahesh says:

    Hi Viswa,

    This is really amazing .I truely appreciate your work. i have just started learning excel and this is te first macro i ve ever tried. Thanks a lot . i would like to learn a lot.



    • Vishwamitra Mishra Vishwamitra Mishra says:

      Thanks Mahesh!!

      • Mahesh says:

        Hi Viswa,

        I am using a excel document currently and all i wanted to do is b running a macro ,it should create a new excel document with copying the values from the document that i currently have. please help me with this.

        • Vishwamitra Mishra Vishwamitra Mishra says:

          Hi Mahesh,
          If you are just trying to make a copy of the same workbook then use the following code: Let me know if this helps you.

          Sub Creat_Copy()
          Dim Wb As Workbook
          Set Wb = ThisWorkbook
          Wb.SaveCopyAs "E:LearnExcelMacro.comExcelFormattedhello.xls"
          End Sub

          • Mahesh says:

            HI Viswa,

            1.i just opened the document



            4.copied the script

            5.changed the file location and ran it.


            Please bear with me since i am a bigginer i am not so good at this. please help me.


          • Vishwamitra Mishra Vishwamitra Mishra says:

            What is the error?

          • Mahesh says:

            Hi Viswa,

            Thanks a lot, i correced the sntax error it worked fine …. hats off to you .. feeling great to reach you in case of any oter help. Please ignore the above two posts.



          • Vishwamitra Mishra Vishwamitra Mishra says:

            Thanks Mahesh !!

  24. […] Code Window in Visual Basic Editor of your Workbook and start writing your first macro.   1. What is Excel Macro ? 2. How to Record Macro / How to Run Macro 3. Add Developer Tab in Excel – 2007 and […]

  25. […] the Previous Article What is Excel Macro of Excel Macro Tutorial, you have read, what is Macro, How to Record Macro and How to Run […]

  26. Shagun says:

    This is amazing Vishwa. You have given a detailed description step by step.

    I am a beginner and didn't even know what a macro is. I have created my first macro. Kudos to you!!!

Leave a Reply