Learn to Create macro in 7 easy steps

May 24th, 2011 by Tips Master | Posted under Excel.

Macro manWhy should you do all the work yourself.  Let the macro work it for you. Ever tried creating a macro in Excel? If the answer is no then please find 7 step illustration to create a simple macro in Excel 2007. Let this be your gentle dive in to the ocean of VBA programming. You will create a simple macro to format the cells . The tutorial is explained using Excel 2007.

 

 

 

Before starting with the recording stuff we need to have the Developer  Ribbon.  So please add the developer ribbon using the steps explained in the following link – Add Developer ribbon

 

Follow the below steps

Step 1 –  Go to Developer tab and press the button Record Macro within the group code.

Step 2 –  This will pop up the record macro window. Give a suitable name and press ok. I have given the name “format” for easy recognition later.

Record Macro Window

Now be careful with this step onwards, because what ever you are doing , Excel will be recording the steps. Don’t select any cells. Just follow the next steps carefully

Step 3 –  Press Ctrl+1 (Format cells ) . Select a suitable fill colour. Select outline border select font calibri, Font size Bold , Size 14 and press ok.

 Format cells in Excel

Format cells

Format cells in Excel 2007

 

Step 4 –   Now press the button stop recording Macro

Stop recording Macro

Step 5 –  Hurray!!! We have successfully completed recording macro.  To run how your macro works , Select the range of cells you want to format and Go to view macros and press the Macros button.

 

View Macros in Excel 2007

Step 6 –  This will Pop up the macros Window. Select the macro you recorded(for me its format) and press the run button.

Macros window

Step 7 –  You can see the changes in the selected cells.

 

Well done !!!  You have learned  to create and run macros in 7 easy steps.

 

To view the recorded macro, go to the macro window explained in the previous step and press the edit button.

 

If the macros are not working properly then check whether macros are enabled in your work book.

Macro Security

Enable macro in Workbook

Meanwhile if you want to learn some advanced VBA try Chandoo, where you can find some excellent online VBA coaching

 

 

 

 

Related posts:

Customize Quick Access Toolbar in Excel 2007
Creating Dynamic Dashboards in excel using combo boxes and dynamic charts
Learn to use watch window in Excel 2007

Comments

3 Responses to “Learn to Create macro in 7 easy steps”
  1. Rasheed says:

    Excellent, I learnt the macros. its really helpful to us

  2. Rasheed says:

    Its really helpful

  3. Dels says:

    excellent!!!

Do you have any comments on Learn to Create macro in 7 easy steps ?