×

Top 15 VBA Interview Questions for 2024

1) What is VBA?

VBA stands for Visual Basic Application. It is an event-driven programming language. It is mainly used with Microsoft Office applications such as MS -Excel, MS-Word and MS-Access.

2) Who is the developer of VBA?

Microsoft is the developer of VBA.

3) What are the two ways to denote comments in VBA?

In VBA, there are two ways to denote comments:
  • Single Qutoe(‘) : Example â€˜Hello World
  • Start with REM keyword : Example REM Hello world

4) What is the use of MsgBox function?

MsgBox function is used to display a message box. Sytntax:
MsgBox(prompt[,buttons][,title][,helpfile,context])

5) How can we create user define functions in VBA?

We can create user define functions by using following syntax:
Function Functionname(parameter-list)  
   statement 1  
   statement 2  
   statement 3  
   .......  
   statement n  
End Function

6) What is the use of InputBox function in VBA?

In VBA, InputBox function is used to take input value.
InputBox(prompt[,title][,default][,xpos][,ypos][,helpfile,context])

7) What is the rule of naming a variable?

There are following rule of naming variable:
  • We should use a letter as the first character.
  • We should use a space , period(.) , exclamation mark (!) or the characters @, &,$,#.
  • Name can’t exceed 225 characters in length.
  • We can’t use Visual Basic the variable before using them

8) How to declare the variable in VBA?

In VBA, Dim keyword is used to declare the variable. Example:
Dim password As String

9) What are the types of operator in VBA?

There are following operators in VBA:
  • Arithmetic Operators
  • Comparison Operators
  • Logical (or Relational) Operators
  • Concatenation Operators

10) What are the loops in VBA?

There following loops in VBA:
  • for loop
  • for ..each loop
  • while..wend loop
  • do..while loops
  • do..until loops

11) What are the predefine String functions in VBA?

In VBA, predefine string functions are:
String functions Description
Lcase It returns the lower case of the specified string.
Ucase It returns the upper case of the specified string.
Ltrim It returns a string after removing the space on the left side of the specified string.
Len It returns the length of the given string.
Replace It returns a string after after replacing a string with another string.

12) How can we declare an Array?

We can declare an array by using given code:
'Method 1 : Using Dim  
Dim arr1()  'Without Size  
'Method 2 : Mentioning the Size  
Dim arr2(5)  'Declared with size of 5  
'Method 3 : using 'Array' Parameter  
Dim arr3  
arr3 = Array("apple","Orange","Grapes")

13) What is the use of ReDim statement in VBA?

In VBA, ReDim statement is used to declare dynamic-array variable and allocate or reallocate storage space. Syntax:
ReDim [Preserve] varname(subscripts) [, varname(subscripts)]

14) What are Array methods in VBA?

In VBA, There are given Array methods:
Array Method Description
LBound It returns an integer that corresponds to the smallest subscript of the given array.
UBound It returns an integer that corresponds to the largest subscript of the given arrays.
Join It returns a string that contains a specified number of values.
Erase It recovers the allocated memory for the array variables.
IsArray It returns a Boolean value that indicates whether or not the input variable is an array.

15) How many types of error in VBA?

In VBA, there are three types of error that are given below:
  • Syntax Errors
  • Runtime Errors
  • Logical Errors

Related Topics

Top 15 C Interview Questions for 2024

1) What are different storage class specifiers in C? Register,auto, static, extern are the storage class specifiers in C. 2) What is scope of a variable? How are variables scoped in C? Scope...

3 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 20 Java Programming Coding Interview Questions for 2024

Coding is an integral part of any programming language. It is the most important phase of an interview. Interviewee checks the capability of thinking of any particular. I think one...

13 minutes read.

A to Z Interview Questions

ABCDEFGHIJKLMNOPQRSTUVWXYZ Interview Questions and Answers List A AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions B Blockchain Interview...

3 minutes read.

Top 13 SAS Interview Questions for 2024

1. What is SAS and its functions? SAS (Statistical Analysis System) is statistical software designed by SAS Institute in 1960 for data inspection and report writing. SAS runs on Windows, UNIX...

5 minutes read.

Top 15 JSP Interview Questions for 2024

1) What is JSP? It is a technology which is used to create web application like Servlet technology. It provides more functionality than Servlet. It consists of HTML and JSP tags. 2) What are...

3 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Top 16 WebGL Interview Questions for 2024

1) What is WebGL? WebGL stands for Web Graphics Library. It is a JavaScript API that is used for rendering 3D graphic in any compatible web browser. It is written in...

3 minutes read.

Top 30 VB Script Interview Questions for 2024

1) What is VB Script? VBScript stands for Visual Basic Scripting Language. It is a light version of Microsoft Visual Basic. It is a client side scripting Language. 2) What is the...

5 minutes read.

Top 30 Fortran Interview Questions for 2024

1) What is Fortran? Fortran is general purpose, high-level programming language which is used for numeric and scientific computing. 2) What are the features of Fortran programming language? Features of Fortran language are: ...

4 minutes read.

Top 30 JSF Interview Questions for 2024

1) What is JSF? JSF stands for Java Server Faces is a Java-Based web application framework. JSF (Java Server Faces) provides a facility to connect UI widgets with data sources. 2) What are...

4 minutes read.

Top 15 XML Interview Questions for 2024

1) What is XML? XML (eXtensible Markup Language) is designed to transport and store data. It has user executive tags i.e. no pre-defined tags used as in HTML. This language is...

2 minutes read.

Top 15 Website Development Interview Questions for 2024

1) What is Website Development? Website Development is a process that includes following steps. web design web content development client-side or server-side scripting network security configuration etc 2) What are the skills...

3 minutes read.

Top 48 C# Interview Questions for 2024

1) Write a program in C# to print "HELLO WORLD"? class Program         {          static void Main(string  args[])           {             System.Console.WriteLine(" HELLO WORLD ");             }          } 2) Write a program in C# to print "TutorialandExample" using namespace? Here, namespace is used to group related classes. Using System;    namespace  TutorialandExample      {         public class           {             public static void Main(string[]  args)             {              Console.WriteLine(" TutorialandExample ");             }          }       } 3) What are the...

8 minutes read.

Top 15 Java JDBC Interview Questions for 2024

1) What are the types of JDBC Drivers in Java? JDBC Drivers are of four types are: JDBC-ODBC bridge driver Native-API driver Network Protocol driver Thin driver 2) What are the five...

4 minutes read.

Top 20 C Programming | Coding Interview Questions for 2024

Most Frequently asked C programming | Coding Interview Questions and answer for Fresher C is a powerful high-level programming language.  It is a fast, portable and available for all platforms. C...

15 minutes read.

Top 16 Moo Tools Interview Questions for 2024

1) What is Moo Tools? MooTools stands for My Object-Oriented Tools. It is a lightweight and object-oriented JavaScript framework. It is used to create dynamic web page. It is developed by Valerio...

5 minutes read.

Top 22 MariaDB Interview Question for 2024

1) What is MariaDB? It is a community based database devoloped by MySQL Devolopers. It provides same features as MySQL also, can be said that it is a replacement of MySQL. 2)...

3 minutes read.

Top 30 AJAX Interview Questions for 2024

1) What is AJAX? AJAX (Asynchronous JavaScript and XML) create better, faster and interactive web-apps. It provides data transfer between web-server and browser. 2) List some advantages of AJAX Advantages are: More Interactive: Very...

3 minutes read.