Macro in Excel in easy steps

Hi Friend, as you know excel is powerful tool for data storage, calculation and analysis. you can also create logical functions having formulas which evolves many steps of calculations. you can fetch data from one or multiple sheets and perform calculations.

Excel provides Developer tool to create macros to automate tasks.
Developer Tab is not available by default in excel and so need to be added using below steps.

  1. Right click anywhere on the ribbon, and then click Customize the Ribbon
  2. Under Customize the Ribbon, on the right side of the dialog box, select Main tabs (if necessary).
    There will be a list of tools in the box.
  3.  Check the Developer check box.

Now you can find the Developer tab next to the View tab.

Create a macro :

i will add a button and on click of button the code to write Hello to cell “A1”

Adding a button on excel sheet:

Developer > Insert > In the ActiveX Controls group, click Command Button and Drag on your worksheet..

Writing a code to display “Hello” in cell “A1”

Right click CommandButton1 (make sure Design Mode is selected) and click on “View Code”. [This will open the Visual Basic Editor]

Close the Visual Basic Editor.

Click the command button on the sheet (make sure Design Mode is deselected).

Macro to sum up the values