wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Visual Basic Applications VBA

Total questions: 74

Worksheet time: 41mins

Name
Class
Date
1.

Shortcut Key for Project Explorer

a)

Ctrl + K

b)

Ctrl + L

c)

Ctrl + R

d)

Ctrl + P

2.

This is where the code that is generated with a macro recorder goes.

a)

Code Window

b)

Module

c)

Immediate window

d)

Properties Window

3.

This is where you’ll write your code or copy paste a code from somewhere else.

a)

Properties window

b)

Module

c)

Immediate Window

d)

Code window

4.

Properties window short cut key

a)

F6

b)

F4

c)

CTRL + P

d)

F8

5.

is mostly used when debugging code

a)

Properties Window

b)

Immediate window

c)

Code window

d)

Module

6.

Contains set of commands the code should execute

a)

Sub procedure

b)

Function Procedure

c)

Reference

d)

Commands

7.

an action or a set of actions that you can run as many times as you want. When you create a -------, you are recording your mouse clicks and keystrokes.

a)

VBA

b)

match index

c)

Macro

d)

Vlook up

8.

Which format shoul be used when saving file with macros?

a)

.xlsx

b)

.xlsm

c)

.html

d)

.pdf

9.

Which shortcut will open Visual Basic Editor?

a)

Alt + F11

b)

Ctrl + Alt + Del

c)

Shift + F8

d)

Shift + Del

10.

An action or set of actions that you can run as many times as you want.

When you create a _____ , you are recording your mouse clicks and keystrokes.

a)

vlookup

b)

match index

c)

sumif

d)

macro

11.

Which word is used to declare a variable?

a)

Dim

b)

Sub

c)

Set

12.

VBA stands for

a)

Visual Basic and Application

b)

Visual Basic for Application

c)

Visual Basic or Application

d)

Visual Basic to Application

13.

1. The programming environment which permits coding, compilation, running and debugging from a single window is called

a)

Integrated Development Environment (IDE)

b)

Editor

c)

Highlighter

d)

Compiler

14.

2. The IDE of VBA supports since it permits drag and drop approach for design of user interface.

a)

Procedural Approach

b)

reverse approach

c)

Rapid Application Development (RAD)

d)

postfix approach

15.

4. VBA supports ready made user interface components like .

a)

UserForm, CommandButton

b)

Label, TextBox, ComboBox, ListBox

c)

TabStrip, OptionButton, ToggleButton

d)

all of them

16.

5. VBA supports through class module.

a)

Object Oriented Programming System (OOPS)

b)

Procedural programming

c)

Functional programming

d)

property based model

17.

6. VBA can be used to automate carried out through MS Excel.

a)

data processing

b)

graphing

c)

accessing cell values

d)

all of them

18.

7. VBA code is compiled into an intermediate code called code.

a)

P-Code

b)

MicroSoft Intermediate Code (MSIL)

c)

Java Virtual Machine (JVM) code

d)

Android Virtual Device (AVD) code

19.

8. MS Excel creates to execute VBA code.

a)

real time computer

b)

mobile computer

c)

tablet computer

d)

virual machine

20.

9. ____is the shortcut to open VBA IDE from MS Excel.

a)

Alt+F11  

b)

Alt+F8 

c)

Ctrl+Break  

d)

Ctrl+G

21.

10._______ is the shortcut to open immediate window in VBA IDE.

a)

Alt+F11

b)

Alt+F8                   

     

c)

Ctrl+Break       

d)

Ctrl+G

22.

11. _______is the shortcut to open list of macros.

a)

Alt+F11                

b)

Alt+F8                   

c)

Ctrl+ Break           

d)

Ctrl+ G

23.

12. is the shortcut to stop execution of programs in VBA IDE.

a)

Alt+F11                

                 

b)

Alt+F8 

c)

Ctrl+ Break          

d)

Ctrl+ G

24.

13. ______ is the shortcut to display information relating to selected component in VBA IDE.

a)

Ctrl+I         

b)

Ctrl+J        

c)

Ctrl+R       

d)

Ctrl+Shift+I

25.

14. ______is the shortcut to properties and methods of a component in VBA

a)

IDE.Ctrl+ I         

b)

Ctrl+ J  

c)

Ctrl+ R  

d)

Ctrl+ Shift+ I

26.

16. ______is the shortcut to display parameter information for selected element in VBA IDE.

a)

Ctrl +I         

b)

Ctrl+ J     

c)

Ctrl+ R       

d)

Ctrl+ Shift+ I

27.

17. _______is the shortcut to add breakpoint in VBA IDE.

a)

F9              

b)

F5   

c)

F1

d)

F2

28.

18. ______is the shortcut to display object browser in VBA IDE.

a)

F9              

b)

F5  

c)

F1   

d)

F2

29.

20.__________structure is useful for decision involving three or more options.

      

a)

Switch       

b)

Select case    

c)

Function  

d)

List

30.

21.  VBA has a coding, compilation, running and debugging environment called

a)

Integrated Development Environment (IDE)

b)

Editor

c)

Highlighter

d)

Compiler

31.

22. In VBA, the function Asc converts given character value to numeric code in______ system.

a)

American Standard Code for Information Interchange (ASCII)

b)

Double Byte Character Set (DBCS)

c)

Unicode

d)

none of them

32.

31. In VBA, Csng function converts String to _______type.

a)

Integer      

b)

Double     

c)

Single       

d)

String

33.

30. In VBA, CInt function converts String to _______type.

a)

Integer      

b)

Double    

c)

Single       

d)

String

34.

32. In VBA, Val function converts String to _______type.

a)

number    

b)

byte           

c)

Currency 

d)

Decimal

35.

38. ________function in VBA formats a number according to given text strings containing 0, # and comma (,).

a)

Format   

b)

CVErr       

c)

InputBox  

d)

MsgBox

36.

39. Boolean data type in VBA has size of ______

       

a)

1 byte

b)

2 bytes      

c)

3 bytes      

d)

4 bytes      

37.

40. Byte data type in VBA has size of________

a)

1 byte        

b)

4 byte        

c)

3 byte        

d)

4 byte        

38.

VBA code can work only with Excel

a)

True

b)

False

39.

If you record a macro, where will it be stored?

a)

In Workbook

b)

In Module

c)

In Classmodule

40.

Which variable is used to store text?

a)

Single

b)

Double

c)

Integer

d)

String

41.

Which Variable can contain text and numbers?

a)

Single

b)

Double

c)

Boolean

d)

Variant

42.

What will this macro do?

Sub copy()

Range("A1").Copy Range("B2")

End Sub

a)

Copy data from A1 and paste to B2

b)

Copy data from A1 and B2

c)

Copy data from B2

d)

Display error

43.

To clear contents of cell, including its formatting, you can use method:

a)

Clear

b)

Clearcontent

c)

Erase

d)

Eraseall

44.

What's the output?

a)

11

b)

65

c)

6

d)

5

45.

What's the output

a)

3

b)

6

c)

9

d)

7

46.

What's the output

a)

1

b)

2

c)

3

d)

4

47.

How do you declare a variable in VBA?

a)

Dim x as String

b)

String a;

c)

x as String

d)

String x as Dim

48.

What's the output?

a)

11

b)

65

c)

6

d)

5

49.

What's the output

a)

3

b)

6

c)

9

d)

7

50.

What's the output

a)

1

b)

2

c)

3

d)

4

51.

How do you declare a variable in VBA?

a)

Dim x as String

b)

String a;

c)

x as String

d)

String x as Dim

52.

Which one is the error?

1. ThisWorkbook.Activate

2. Worksheets("Sheet1").Activate

3. WorkBook("OH Stock.xlsx").Activate

4. Sheets("PivotTable").Select

a)

1

b)

2

c)

3

d)

4

53.

What's the output

a)
b)
c)
d)
54.

What's the output

a)

A

b)

B

c)

C

d)

Not Pass

55.

What's the output

a)

20000

b)

Error

c)

10000

d)

30000

56.

What's the output

a)

20000

b)

Error

c)

15000

d)

35000

57.

How to make D4 be like this

a)

Range("D4").FormulaR1C1 = "=SUM(R[-3]C[-3]:R[-1]C[-1])"

b)

Range("D4").Value = "=SUM(R[-3]C[-3]:R[-1]C[-1])"

c)

Range("D4").Value = "=SUM(A1:C3)"

d)

Range("D4").Formula2R1C1 = "=SUM(R1C1:R3C3)"

58.

What's the output

a)

A

b)

B

c)

C

d)

Not Pass

59.

What's the output

a)

20000

b)

Error

c)

10000

d)

30000

60.

What's the output

a)

20000

b)

Error

c)

15000

d)

35000

61.

Which is a correct statement in VBA?

a)

If x>50,x<100 then

b)

If 50<x<100 then

c)

If x>50 & x<100 then

d)

If x>50 and x<100 then

62.
When the number of repetitions needed for a set of instructions is known before they are executed in a program, the best repetition structure to use is a(n) 
a)

Do While...Loop structure.

b)

Do...Loop Until structure. 

c)

For...Next loop

d)

If blocks

63.

If you don't declare a data type, what is a default data type in VBA?

a)

Variant

b)

String

c)

Integer

d)

Not known

64.

In order to let users enter a value in a box, which one of the following VBA internal function you need to use?

a)

MsgBox

b)

InputBox

c)

OutputBox

d)

MessageBox

65.

Attribute of data which tells the compiler or interpreter how the programmer intends to use the data.

a)

Data Type

b)

Variable

c)

Int

d)

String

66.

Non-Numeric data type that uses True or False.

a)

Object

b)

String

c)

Date

d)

Boolean

67.

Function Key to run all lines of code of a Sub Procedure in VBA IDE.

a)

F4

b)

F5

c)

F6

d)

F7

68.

A function can return a value to be used later in the program

a)

True

b)

False

69.

A procedure can return a value to be used later in the program

a)

True

b)

False

70.

The Macro Recorder is located in the _________ Tab.

a)

INSERT

b)

REVIEW

c)

DATA

d)

DEVELOPER

71.

Recorded macros can be edited in the _________________.

a)

Visual Basic Spreadshhet

b)

Visual Basic Editor

c)

Visual Basic Documents

d)

Visual Basic Viewer

72.

Visual Basic Studios is an example of _______________________ programming?

a)

Object-oriented

b)

Natural language

c)

Operands

d)

Procedural

73.

Click is an example of:

a)

an event

b)

a variable

c)

a component

d)

a property

74.
 ………. is a collection of Objects  
a)
A. Class
b)
B. Group
c)
C. Project
d)
D. Form