Visual Basic for Applications

The code is written in a Language called

Visual Basic for Applications (VBA).

Although Visual Basic is a Programming Language that has been around for some time it became part of Excel with version 5.

It is important in that Microsoft intends to add Visual Basic to all its Applications software as a replacement for the existing variety of Macro languages that currently exist.

The VBA code in your macro was created automatically as you recorded your mouse clicks and keystrokes.

Lets examine your code.

macro3

As an alternative you could have created the code by typing directly into the Module sheet.

Exercise - Entering a Macro directly into the Module

Select Tools - Macro - Visual Basic Editor

Click on the Module.

Move your cursor to the line containing your name.

Add your surname to your first name.

Return to worksheet, View - Microsoft Excel Locate the cursor in an empty cell.

From the menu, select Tools - Macro

Run Yourname macro.

You should now see your full name displayed in the cell

pencilb

Practice Exercise

You should attempt the VBA macro - Exercises a, b and c from the Spreadsheet Exercises listed in the Topic Menu below.