What is a VBA Procedure?
-
The word Macro is slang for the word
VBA procedure. It is a throw back to pre 1994 Microsoft Excel.
-
A procedure is defined as a named group
of statements that are run as a unit.
-
VBA procedures are used to perform
tasks such as controlling Excel’s environment, communicating with
databases, calculating equations, analyzing worksheet data, creating
charts…etc
-
A VBA procedure unit or block consists
of a procedure statement (Sub or Function) and an ending statement with
statements in between.
-
A VBA procedure
is constructed from
three types of statements: executable, declaration and assignment
statements. The statements between a procedure’s declaration and ending
statement (i.e. Sub and End Sub) perform the procedure's task; what you are
trying do.
-
Procedures are typed and stored in a
Module
-
Procedures are
executed or run in order to
carry out their statements. When a procedure
is run, its statements (i.e. lines) are executed in a top-down line
by line fashion performing operations. Think of reading a book page.
Note that typing a procedure in a module does not run it. You must
do this after typing it by variety of different methods. Until you
run it, it is just basically text sitting in a document.
-
VBA has two
basic types of procedures that you can create: Sub
procedures and Function procedures.
Sub Procedures
-
Sub procedures are written when you
want to command Excel like creating a chart, analyzing data, coloring
cells, copying and pasting data...etc. A simple Sub procedure is
pictured below.

VBA Sub Procedure
Function Procedures

VBA Function Procedure
What
VBA Procedure to Write
-
So if you want to do a task in Excel,
you write a Sub procedure, if you want to write a custom worksheet
function, you write a Function procedure. Are their grey areas between
the two where they can do the same thing, yes, but do not worry about them when first starting out.
<<What is
a VBA Module and How is It Used?
How is VBA Used?>> |
Need Help Learning Excel VBA?
Let our Microsoft Excel VBA
workshops below show you how to command Excel in ways you never thought
possible. They are unlike anything
taught on the training market today.
|
Free
Workshop Repeats
All
of our workshops come with free repeats. We understand
learning takes time.
Details |
|
EMAGENIT Customers and
Awards
At
EMAGENIT, we have trained customers like:
-
Janus Capital, HSBC,
Deutsche Bank, Google, Apple, BMW, Capital One and
Disney (View More)
We have also trained organizations
like ICE, NASA, The US Army, Navy, Air Force and Marines and
develop custom Excel software for the likes of Caterpillar and
NASA (Award). Our
diverse training background and software projects ensure you get
the best Excel training drawn from real world experience not
academia. |
|
Beginning Microsoft Excel VBA
- Business |
Our 2-day Excel VBA workshop shows you
"hands-on" the basics of using VBA
(macros) to command Excel, process and reconcile
worksheet data,
create charts, build pivot tables, build basic dashboards, command Word
/ PowerPoint and more.
Complete Outline and Signup
Available:
Public Seminar, Company Onsite, Live Webinar,
Self-Study |
|
Advanced Microsoft Excel VBA
- Business |
Our 3-day
Excel VBA workshop shows you
"hands-on" how to construct
advanced dashboard and data analysis business tools in
Excel. Discussed is multi file/folder processing,
ActiveX controls, databases, userforms and advanced
command of Excel including pivot tables and charts. It not only
shows how to control Excel, it shows how to tie
into other systems as well.
Complete Outline
and Signup
Available:
Public Seminar, Company Onsite, Live Webinar,
Self-Study |
|
Beginning Microsoft Excel VBA
-
Engineering & Science |
Our
2-day
Excel VBA workshop shows you "hands-on"
from an engineering & science perspective the basics of using VBA
to command Excel, process and reconcile data, control
worksheets and workbooks, control ranges, create
charts, create functions, build powerful models, build
dashboards and command Word and PowerPoint.
Complete Outline
and Signup
Available:
Public Seminar, Onsite, Live Webinar,
Self-Study |
|
Advanced Microsoft Excel VBA
- Engineering & Science |
Our 3-day Excel VBA workshop
shows you
"hands-on" from an engineering &
science perspective how to create advanced data
analysis tools, system models, database tools, dashboard tools
and program integration tools using Excel VBA.
Complete Outline
and Signup
Available:
Public Seminar, Company Onsite, Live Webinar,
Self-Study |
|