Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

View – Macros – Edit Alt + F11 Display VBA editor

Ctrl + R Display Project Explorer panel


F5 Run the code
Type “Private/Public” in front of Sub/Function in
a Module to make a subroutine to limit the
scope to a worksheet
Alt+F8 Shows macros
Ctrl+E/Ctrl+M Export module/Import module

In general, a VBA module can hold three types of code:


Declarations: One or more information statements that you provide to VBA. For
example, you can declare the data type for variables you plan to use or set some
other module-wide options. Declarations are basically housekeeping statements.
They aren't actually executed.
Sub procedures: A set of programming instructions that, when executed, performs
some action.
Function procedures: A set of programming instructions that returns a single
value (similar in concept to a worksheet function, such as SUM).

To continue a single line of code (also known as a statement) from one line to the
next, end the first line with a space followed by an underscore (_). Then continue
the statement on the next line. And don't forget the space. An underscore character
that's not preceded by a space won't do the job.

You might also like