You are on page 1of 1

Advanced VBA Interview Questions and Answers

1. What is Option Explicit

Option Explicit force the variables to be declared befre using the variable. This is one of of the best
practices for VBA developers to avoid the type errors and build the error free applications.

2. What are different Types of core Modules available in VBE?

Code Module: Default Modules which we use to write all procedures and functions

UserForms: UserForms helps to develop GUI (Graphical User Interface) applications.

Class Modules: Class module allows to create new objecs and define methods, properties and events.
Also, it will allow to enhance the existing objects.

3. What is the difference between Procedure and Functions?

Procedures or Subroutines will not return a value; functions will return values.

4. Explain how can you pass arguments to VBA functions?

Arguments can be passed in two ways in VBA Subroutines and Functions:

ByVal: When an argument is passed By Value, the value assigned to the argument is passed to the
procedure. And any changes that are made to the argument inside a procedure, it will be lost when the
procedure is ends.

ByRef: When an argument is passed By Ref, the actual address assigned to the argument is passed to the
procedure. And any changes that are made to the argument inside the procedure will be passed when
the procedure ends.

And By Ref is default in VBA.

You might also like