0% found this document useful (0 votes)
38 views

Macros Rules

This document discusses macros in Microsoft Excel. It defines a macro as a set of Visual Basic for Applications (VBA) instructions that automates tasks in Excel. Macros can be recorded to capture actions or manually written. The VBA environment stores recorded macros in modules attached to workbooks. It allows naming conventions for macros and describes the basic structure of macro code, including the use of keywords like SUB and END SUB to delineate the start and end of a macro.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Macros Rules

This document discusses macros in Microsoft Excel. It defines a macro as a set of Visual Basic for Applications (VBA) instructions that automates tasks in Excel. Macros can be recorded to capture actions or manually written. The VBA environment stores recorded macros in modules attached to workbooks. It allows naming conventions for macros and describes the basic structure of macro code, including the use of keywords like SUB and END SUB to delineate the start and end of a macro.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

MACROS

Microsoft Excel

What is a Macro?
A

macro is a set of instructions that


tells Excel what to do. These
commands are written in a
computer programming language
called Visual Basic Applications
(VBA).
A macro is also referred as
Procedures.

Just

as a tape recorder can be used


to record sounds which can be
played back later, so as the Macro
Recorder can record actions into a
macro. These macros can be run
whenever you wish, automatically
repeating your recorded actions and
so saving your time and effort.

There

are two ways to create a


macro: You can record it or you
can build it by entering
instructions in a module. Either
way, your instructions are encoded in
the programming language
Microsoft Visual Basic for
Applications (VBA).

In

naming a macro,

The first character of the macro must be


a LETTER.
The following characters can be letters,
numbers, or underscore characters.
Spaces are not allowed in a macro
name; use an underscore character ( _ )
as word separator.

VBA Environment

Each time you record a macro, the macro


is stored in a module attached to a
workbook. Recorded macros can be stored
in This Workbook, New Workbook,
and Personal Workbook.

What is Excel VBA?


VBA stands for Visual Basic for
Applications. It's a programming language
that enables you to control just about
everything in Excel.

VBA Environment
The

first and last lines of the code


act as the beginning and
endpoints for the macro youve
recorded.
A Sub statement starts the macro
End Sub statement ends the
macro.

Special

VBA terms, also called


keywords are displayed in dark
blue.
SUB this is a keyword that begins a
Macro and is followed by the name of
the macro.
COMMENTS- the comments are
entered following an apostrophe. VB
ignores the apostrophe.

STATEMENTS-

Each action
carried out by the Macro is
written in statements. The
syntax of a statement is an
Object followed by the Action
END SUB- This is a keyword that
ends the Macro.

You might also like