Recording macros

Looking at the code

Ways of running macros

Where macros are stored

Reasons to write macros

Writing macros

Procedure types

Visual Basic editor (VBE)

Rules & conventions

Excel objects

Range/Selection objects

Object hierarchy

Object browser

Chart objects

Pivot Table objects


Visual Basic Functions

Creating Add-Ins

Variables & constants

Object variables



Message Box

VBA Input Box

Excel Input Box

Making decisions (If)

Making decisions (Case)

Looping (Do...Loop)

Looping (For...Loop)

With...End With blocks

User defined functions

Event handling

Error handling


Creating User Forms

DAO/ADO Objects

Input/Output Files


Other links

Example code snippets

Userform input example





Welcome to Excel VBA Programming

VBA stands for Visual Basic for Applications (the application being of course Excel) and is the technology and tools used to program and automate Microsoft Excel.

It's not only used just within the framework of Microsoft Excel but other applications too including Microsoft Access, Microsoft Word, Microsoft Outlook to name but a few.

It has the power to communicate with other applications beyond the Microsoft range and even the Microsoft Windows operating system across other platforms.

So, learning the principles of VBA using Excel as the tool environment will stand you in good stead for the other applications should you wish to program and code them in the future.

The only difference between other applications when wanting to use VBA will simply be learning to load and work with different libraries (which I intend to teach you in due course throughout this free online reference guide).


This site is used in conjunction with my classroom instructor lead teaching (for my students attending an Excel VBA course) and is intended as a reference guide only. But if you have attended or taught Excel VBA yourself, this will help you too.


You will start by learning to record, edit and manage macros in Excel capturing the VBA code automatically giving you the confidence and basic knowledge to the VBA code language itself.

Excel - Record Macro tool

At some point you will want to get down to learning about the power of VBA using Excel as the environment tool to test the code. This will introduce you to the programming conventions, concepts and techniques that simply go beyond the scope of the Excel Macro Recorder tool.

VBE Interface - where VBA code is managed

There is a lot more VBA code that can not be recorded which include logic testing, iteration, interactive macros, creating functions and assigning variables.

I will gently ease you into learning VBA code smoothing out the steep learning curve as much as possible.


I hope you find this resource helpful, Thank you!

Ben Beitler


Want to teach yourself Access? Free online guide at About Access Databases

Note: Excel Version illustrated throughout this website is based on 2007 and therefore  some of the commands may vary on previous versions.


Home | Terms of Use | Privacy Policy | Contact

copyright 2010 TP Development & Consultancy Ltd, All Rights Reserved.

All trademarks are copyrighted by their respective owners. Please read our terms of use and privacy policy.