Excel VBA

Home/Excel VBA

Excel VBA is the macro programming language available in the Excel and other MS office tools. It helps to automate the regular tasks, create the dashboards and build the tools to perform certain tasks.

Interacting with Other Applications using VBA


We can interact with the other applications using VBA - with the MS Office Applications like Word, PowerPoint,Outlook,etc... and other applications like Internet Explorer, SAS,etc.

In this Section:
  • Introduction?
  • How to interact with MS Word? - Late Binding
  • How to interact with MS Word? - Early Binding
  • How to interact with PowerPoint? - Early Binding
  • How to interact with Outlook? - Late Binding
  • Example File

VBA Security in Excel

It is important to understand the macro security if you are dealing with the Macro Enabled Files. It helps to protect your data from the malicious programs and helps to know how to run the macros when its required.

In this Section:
  • Understanding VBA Security
  • What are the different Levels of the Security in VBA?
  • How to Enable or Disable the Macros?
  • How To Protect VBA Code?

VBA Objects Properties and Methods in Excel

Most of the programming languages today are Object Based Or Object Oriented Programming Languages. Although Excel VBA is not a truly object oriented programming language, it does deal with objects.

In this topic:
  • What are Objects?
  • What are Properties?
  • What are Methods?
  • What is Object Browser?

Forms and Controls in Excel VBA

Any Windows Application is equipped with set of objects called windows controls. The Main control is called a Form, it is the primary window contains different types of controls which allow user to interact with the computer. The following is a simple form to calculate square value of a given number.

In This Section:
  • What Are UserForms?
  • What Are ActiveX Controls?
  • What Are The Different UserForm Controls & Use?
  • Practical Learning: Developing A Simple UserForm
  • Example File

Passing Arguments in Excel VBA

We write the procedures to perform certain tasks and some times we may required to write another procedure with small variations. In this situation we can take advantage of the Passing Arguments.

In this Section:
  • What are By Value (ByVal) and By Reference (ByRef) Passing Arguments?
  • Writing a procedure or a function with Arguments
  • How to call a function or a procedure?
  • Example macro file to explain passing arguments

Arrays in Excel VBA

When we work with one item we required to use one variable, if you want work with more than one item, we can go for arrays. Arrays are the variables which allow us to store more than one value.

In this topic:
  • What is an Array?
  • What are the different types of arrays?
  • One Dimensional Array:
  • Multi-Dimensional (Two Dimensional) Arrays:
  • How to Re-size an Array?
  • Array Options
  • Example File

Scope of Variables in Excel VBA

When we are working with variables, it is important to understand the Scope of a Variable. The Scope describes the the accessibility or life time or visibility of a variable. There are four levels of Scope:

  • Procedure-Level Scope
  • Module-Level Scope
  • Project-Level Scope
  • Global-Level Scope