0% found this document useful (0 votes)
319 views

Advanced VBA Interview Questions and Answers

Option Explicit forces variables to be declared before use, avoiding type errors and building more robust applications. There are three main types of modules in VBA: code modules for writing procedures and functions, userforms for graphical interfaces, and class modules for creating reusable objects. Procedures do not return values while functions do. Arguments can be passed to procedures and functions by value (ByVal), where changes are lost after the procedure ends, or by reference (ByRef) where changes persist after the procedure ends.

Uploaded by

Hashmi Majid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
319 views

Advanced VBA Interview Questions and Answers

Option Explicit forces variables to be declared before use, avoiding type errors and building more robust applications. There are three main types of modules in VBA: code modules for writing procedures and functions, userforms for graphical interfaces, and class modules for creating reusable objects. Procedures do not return values while functions do. Arguments can be passed to procedures and functions by value (ByVal), where changes are lost after the procedure ends, or by reference (ByRef) where changes persist after the procedure ends.

Uploaded by

Hashmi Majid
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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