Sie sind auf Seite 1von 125

Module M

Programming in Excel with VBA

Multiple Choice Questions

1. VBA is:

A. a programming language developed by Microsoft to extend and customize


Excel.

B. a graphical user interface that allows a novice Excel user to build complex
worksheets.

C. a programming environment built by a non-profit group of programmers that


can be used with Excel.

D. a programming environment developed by Microsoft that can be used instead


of Excel and Access for complex applications.
2. Which of the following Excel tools allows you to automate the building and
running of complex calculations that are not included in the standard set of Excel
functions?

A. Function builder

B. Query-by-example tool

C. Wizard

D. VBA

3. Units of VBA code are often referred to as ____.

A. subroutines

B. routines

C. macros

D. programs

4. Which of the following Excel tools allows you to record a sequence of commands
in Excel and save them?

A. The key logger tool

B. The query-by-example tool

C. A Sub procedure

D. The macro recorder


5. Which of the following is a programming language that includes build-in
commands that mimic the functionality available from menus and dialog boxes
within an application?

A. Binary code

B. Object-oriented programming language

C. Macro language

D. HyperText Markup Language

6. Which of the following is a set of Excel actions recorded or written by a user?

A. A macro

B. A hyperlink

C. A botnet

D. A rootkit

7. Mr. Joseph is the CEO of a leading manufacturing concern. He wanted his name
and designation to appear in italics on all the spreadsheets of the company's
annual report. Which of the following Excel action should he use to achieve this?

A. A wizard

B. A rootkit

C. A macro

D. A botnet
8. Dan was making a science project. He wanted to automate the two steps of adding
a background theme to the cells and then printing the worksheet. Which of the
following Excel actions can help Dan achieve this?

A. A system program

B. A macro

C. A hyperlink

D. An auto function

9. Which of the following statements is true about a macro in Excel?

A. It is used to access the functions available in Excel.

B. It is used to convert an Excel worksheet into a PDF document.

C. It is used to scramble the contents of an Excel worksheet so that it can't be read


without the right key.

D. It is used to automate a series of Excel steps and to set up buttons and dialog
boxes.
10. Which of the following is a built-in function in Excel and does not require a
macro?

A. Inserting a company name on all spreadsheets

B. Creating a custom toolbar button

C. Performing a specific calculation on multiple workbooks

D. Computing Sum and Average

11. Which of the following tools enables users to view and edit a VBA macro?

A. Web authoring software

B. Visual Basic Editor

C. Query-by-example tool

D. Visual Basic Analyzer

12. Which of the following is a component of a macro that performs some action on
or with objects?

A. A Function procedure

B. A Sub procedure

C. A visual procedure

D. A Sub macro
13. Which of the following is a VBA macro that returns a single value?

A. A Sub procedure

B. A Function procedure

C. An Object procedure

D. A Sub Macro

14. Which of the following is true about Function procedures?

A. Function procedures return a single value.

B. The end of a Function procedure is marked by the keyword End Sub.

C. The macro recorder can produce Function procedures.

D. Function procedures refer to one or more information statements that you


provide to VBA.

15. Which of the following VBA macros can be used in a worksheet formula?

A. An integrity constraint

B. An Object procedure

C. A primary key

D. A Function procedure
16. Which of the following does a VBA macro manipulate?

A. A constant

B. A variable

C. An object

D. A sub macro

17. A(n) _____ in VBA is an item available for you to control in your code.

A. constant

B. object

C. sub macro

D. variable

18. Which of the following refers to a place used to store a piece of information in
Excel?

A. A cell

B. A variable

C. A macro

D. A field
19. Which of the following keys will you press to activate the VBE when Excel is active?

A. Ctrl+F9

B. Ctrl+V

C. Alt+F11

D. Alt+V

20. When working on a worksheet, Ben was editing his macros using the Visual Basic
Editor (VBE). After a while he wanted to go back to the Excel application interface.
Which of the following key(s) should Ben use to toggle between the Excel
application interface and the VBE?

A. Ctrl+F9

B. Ctrl+V

C. Alt+F11

D. Alt+V

21. Which of the following VBA windows shows every workbook that is currently open
in Excel?

A. The Project Explorer Window

B. The Code Window

C. The Properties Window

D. The Immediate Window


22. Which of the following key(s) will display the Project Explorer window if it is not
visible on the VBE Program Window?

A. Ctrl+F11

B. Ctrl+W

C. Alt+W

D. Ctrl+R

23. Which of the following is true about the Project Explorer window?

A. It is most useful for executing VBA statements directly.

B. It contains VBA code.

C. It displays a tree diagram that consists of every workbook currently open in


Excel.

D. It shows you the properties that can be changed for the currently active object
in the Project Explorer window.

24. Which of the following VBA windows will you use to debug your VBA code?

A. The Project Explorer Window

B. The Code Window

C. The Properties Window

D. The Immediate Window


25. Which of the following key(s) will display the Immediate Window if it is not visible
on the VBE Program Window?

A. Ctrl+W

B. Ctrl+G

C. Alt+W

D. Ctrl+I

26. Which of the following is true about the Immediate window?

A. It shows you the properties that can be changed for the currently active object
in the Project Explorer window.

B. It displays a tree diagram that consists of every workbook currently open in


Excel.

C. It can be displayed by pressing Ctrl + R.

D. It is most useful for executing VBA statements directly.

27. When you record a macro, Excel automatically inserts a VBA _____ to hold the
recorded code.

A. constant

B. object

C. module

D. variable
28. When entering code directly into a module, which key should be used to indent
some of the lines to make the code easier to read?

A. Tab

B. Shift

C. Ctrl

D. Alt

29. While entering a VBA code directly, to continue a single line of code from one line
to the next, end the first line with:

A. a space followed by an equal sign.

B. a continue Sub statement.

C. a space followed by an underscore.

D. a space followed by a double quote.

30. Sub procedures start with the keyword Sub followed by the name of the procedure
and opening and closing:

A. double quotes.

B. parentheses.

C. single quotes.

D. guillemets.
31. Which of the following statements is true of a user defined function?

A. It can be written when the function needed is already in Excel.

B. It can increase the complexity of a worksheet.

C. It can increase productivity.

D. It can be recorded in a macro recorder.

32. Which of the following is the simplest type of VBA statement?

A. A macro

B. A For-Next loop

C. An assignment

D. A comment

33. With which of the following would you begin a comment line?

A. A single quote

B. A double quote

C. An underscore

D. An equal sign
34. Which of the following elements of VBA programming may change during the
execution of a procedure?

A. A constant

B. A variable

C. A comment

D. A macro

35. Which of the following would be considered a named element whose value would
not change during the execution of a procedure?

A. A variable

B. A constant

C. A comment

D. A macro

36. Which of the following data type uses 2 bytes and whose range of values is true or
false?

A. Boolean

B. Integer

C. Double (negative)

D. Double (positive)
37. Which of the following data type uses 1 byte per character and whose range of
values varies?

A. Boolean

B. String

C. Integer

D. Currency

38. Excel and VBA can work with both numbers and text. Text is often referred to as
____.

A. a variable

B. an object

C. a string

D. a subroutine

39. What type of strings theoretically can hold as many as 2 billion characters?

A. Recurring-length strings

B. Definite-length strings

C. Fixed-length strings

D. Variable-length strings
40. Which of the following options would describe the process of creating variables
simply by using them?

A. Definite variable declaration

B. Implicit variable declaration

C. Explicit variable declaration

D. Composite variable declaration

41. Which of the following describes the process of defining the names of all the
variables you are going to use, before you use them in your code?

A. Definite variable declaration

B. Precision variable declaration

C. Explicit variable declaration

D. Implicit variable declaration

42. Which of the following is used to declare an explicit variable with VBA code?

A. A Dim statement

B. A comment

C. An assignment statement

D. A string
43. In VBA, dates and times are placed between two:

A. ~ symbols.

B. # symbols.

C. * symbols.

D. " symbols.

44. Which of the following is a VBA statement that allocates the result of an expression
to a variable or an object?

A. A Dim statement

B. A function statement

C. An assignment statement

D. A detail statement

45. In VBA, which of the following symbols represents the exponentiation operator?

A. ^

B. *

C. /

D. &
46. In VBA, which of the following logical operators performs the function of
conjunction on two expressions?

A. And

B. Eqv

C. XoR

D. Imp

47. In VBA, which of the following logical operators performs the function of
disjunction on two expressions?

A. Not

B. Or

C. And

D. XoR

48. In VBA, which of the following logical operators performs the function of exclusion
on two expressions?

A. And

B. Eqv

C. XoR

D. Imp
49. In VBA, which of the following logical operators performs the function of negation
on an expression?

A. XoR

B. Or

C. Imp

D. Not

50. Which of the following operators has the highest precedence in VBA?

A. Division

B. Addition

C. Multiplication

D. Exponentiation

51. Which of the following is true about the way a macro works?

A. It skips over some statements as it executes the code

B. It executes some statements multiple times

C. It tests conditions to determine what the procedure does next

D. It starts at the code's beginning and progresses line by line to the end
52. Which of the following statements is VBA's most important control structure?

A. For-Next

B. If-Then

C. Do-Until

D. Do-While

53. When you want to execute one or more statements conditionally, what VBA
structure would you use?

A. If-Then

B. Do-While

C. For-Next

D. Do-Until

54. Which of the following VBA structures is recommended in a decision involving


three or more options?

A. If-Then

B. Select-Case

C. Looping

D. Do-While
55. When VBA executes a Select Case structure, the structure is exited:

A. as soon as VBA finds a true case.

B. after VBA executes the statements for a true condition.

C. after VBA executes the statements for a false condition.

D. as soon as VBA finds a false case.

56. Which of the following terms refers to repeating a block of statements or code
numerous times?

A. Redacting

B. Linking

C. Looping

D. Concatenating

57. Which of the following is the simplest type of looping statement?

A. Do-While

B. Do-Else

C. Do-Until

D. For-Next
58. Which VBA loop structure is controlled by a counter variable, which starts at one
value and stops at another value?

A. For-Next

B. Do-Until

C. Do-While

D. Else

59. In which of the following VBA structures, a macro continues to execute the loop
until a specified condition is met?

A. For-Next loop

B. If-Then loop

C. Do-While loop

D. Do-Next loop

60. Which of the following is true about the Do-Until loop structure?

A. In a Do-Until loop, the macro executes the loop until the condition is false.

B. A Do-Until loop continues until a specified condition is met.

C. A Do-Until loop is the simplest type of loop.

D. A Do-Until loop is similar to the Do-While structure.


True / False Questions

61. VBA stands for Virtual Basic for Applications.

True False

62. Units of VBA code are called subroutines.

True False

63. To use VBA in an Excel worksheet, you must purchase a separate plug-in module.

True False

64. The macro recorder is a software tool that lets you record a sequence of
commands in Excel and save them as a macro.

True False

65. VBA is only a programming language and not a macro language.

True False

66. A macro is a set of actions recorded or written by a user.

True False
67. You can use VBA to create your own worksheet functions.

True False

68. A VBA macro can be used to print your company name and logo at the top of all
worksheets.

True False

69. You can customize the Excel toolbars with your own buttons that execute the
macros you write.

True False

70. The Visual Basic Editor is used to record a sequence of commands in Excel to save
them in a macro.

True False

71. A Sub procedure is a VBA macro that returns a single value.

True False

72. You view and edit VBA macros using the Function procedure.

True False
73. A variable in VBA is an item available for you to control in your code.

True False

74. Excel must be running before a VBA macro can be edited using the VB editor.

True False

75. The quickest way to activate the VBE is to press Ctrl + F11 when Excel is active.

True False

76. If the Project Window is not visible in VBE, press the Ctrl + W to open it.

True False

77. When working in VBE, an object is considered as a collection of projects.

True False

78. A single VBA module can store any number of Sub procedures, Function
procedures, and declarations.

True False
79. When typing code directly into a VBA macro, the Ctrl key is used to indent some of
the lines to make the code easier to read.

True False

80. When saving an Excel workbook, any macro that has been created will
automatically get saved within the workbook.

True False

81. Excel's VBA macro recorder makes it easy to record user defined functions.

True False

82. A variable is the simplest type of VBA statement.

True False

83. In a VBA statement, a comment begins with a double quote (").

True False

84. To assign a value to a variable, you must use the equal sign operator.

True False
85. It is permissible to use spaces when assigning variable names.

True False

86. Excel and VBA can work with both numbers and text.

True False

87. Variable-length strings theoretically can hold as many as 2 billion characters.

True False

88. An assignment statement is a VBA statement that assigns the result of an


expression to a variable or an object.

True False

89. The operator XoR performs the logical inclusion on an expression.

True False

90. A macro is a VBA procedure that starts executing the code at the beginning and
progresses line by line until it reaches the end.

True False
91. The Select Case structure is used for decisions involving 2 options.

True False

92. The term looping refers to repeating a block of statements or code numerous
times.

True False

93. In a Do-While loop, the macro executes the loop until the condition is true.

True False

Fill in the Blank Questions

94. _____ extends and customizes Excel, allowing you to do things that Excel itself is
not able to do, such as calculating values in cells based on user input values.

________________________________________

95. Units of VBA code are called ____.

________________________________________
96. The _____ is a software tool that lets you record a sequence of commands in Excel
and save them as a macro.

________________________________________

97. A(n) _____ is a set of actions recorded or written by a user.

________________________________________

98. A(n) _____ is a set of programming instructions that performs some action on or
with objects.

________________________________________

99. A(n) _____ is a VBA macro that returns a single value.

________________________________________

100.Visual Basic for Applications (VBA) manipulates ____, such as a workbook, a


worksheet, a cell range, a chart, or a shape.

________________________________________

101.A(n) _____ can be used in VBA macro to store such things as values, text, or
property settings (such as a font color or alignment).

________________________________________
102.The _____ is a separate application where you write and edit your Visual Basic
macros.

________________________________________

103.The quickest way to activate the Visual Basic Editor (VBE) is to press _____ when
Excel is active.

________________________________________

104.In the Visual Basic Editor (VBE), the _____ window displays a tree diagram that
consists of every workbook currently open in Excel.

________________________________________

105.The _____ window is most useful for executing VBA statements directly and for
debugging code.

________________________________________

106.When you're working in the Visual Basic Editor (VBE), each Excel workbook that's
open is known as a(n) ____.

________________________________________
107._____ is a type of code which consists of one or more statements that you provide
to VBA.

________________________________________

108.All macros reside in code modules of which there are two types: _____ and _____
modules.

________________________________________

109.The macro recorder can only produce _____ procedures.

________________________________________

110.If the function you need is not already in Excel, you can write your own _____ using
VBA.

________________________________________

111. A(n) _____ is the simplest type of VBA statement.

________________________________________

112.To assign a value to a variable, you must use the _____ operator.

________________________________________
113.When assigning variable names, you can use letters, numbers, and some
punctuation characters, but the first character must be a(n) ____.

________________________________________

114.In the context of the elements of VBA programming, a(n) _____ is a named element
whose value doesn't change.

________________________________________

115.A(n) _____ data type uses 2 bytes and its range of values is True or False.

________________________________________

116.Excel and Visual Basic for Applications (VBA) can work with both numbers and text.
Text is often referred to as a(n) ____.

________________________________________

117.In VBA, _____ are declared with a specified number of characters.

________________________________________

118.If you want to declare a variable explicitly, you do so using a _____ statement.

________________________________________
119.A(n) _____ is a VBA statement that assigns the result of an expression to a variable
or an object.

________________________________________

120.In the context of the precedence order for operators in VBA, _____ has the highest
precedence.

________________________________________

121.Some Visual Basic for Applications (VBA) procedures, such as ____, always start at
the code's beginning and progress line by line to the end, never deviating from
this top-to-bottom flow.

________________________________________

122.In the context of the standard structured decision offered by VBA, the _____
structure is suggested for decisions involving three or more options.

________________________________________

123.The term _____ refers to repeating a block of statements or code numerous times.

________________________________________
124.A(n) _____ loop continues to execute until a specified condition has been met.

________________________________________

125.In a _____ loop, the macro executes the loop until the condition is true.

________________________________________
Module M Programming in Excel with VBA Answer Key

Multiple Choice Questions

1. VBA is:

A. a programming language developed by Microsoft to extend and customize


Excel.

B. a graphical user interface that allows a novice Excel user to build complex
worksheets.

C. a programming environment built by a non-profit group of programmers


that can be used with Excel.

D. a programming environment developed by Microsoft that can be used


instead of Excel and Access for complex applications.

VBA, which stands for Visual Basic for Applications, is a programming language
developed by Microsoft. Excel, along with the other members of Microsoft
Office, includes the VBA language. VBA extends and customizes Excel, allowing
you to do things that Excel itself is not able to do, such as calculating values in
cells based on user input values.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction

2. Which of the following Excel tools allows you to automate the building and
running of complex calculations that are not included in the standard set of
Excel functions?

A. Function builder

B. Query-by-example tool

C. Wizard

D. VBA

VBA extends and customizes Excel, allowing you to do things that Excel itself is
not able to do, such as calculating values in cells based on user input values.

AACSB: Technology
Blooms: Understand
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 2 Medium
Topic: Introduction
3. Units of VBA code are often referred to as ____.

A. subroutines

B. routines

C. macros

D. programs

Units of VBA code are often referred to as macros.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction
4. Which of the following Excel tools allows you to record a sequence of
commands in Excel and save them?

A. The key logger tool

B. The query-by-example tool

C. A Sub procedure

D. The macro recorder

The macro recorder is a software tool that lets you record a sequence of
commands in Excel and save them as a macro. This is invaluable if you are
struggling with some programming syntax. Just get the recorder to do it for you
and then view the code to see how it is done.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction
5. Which of the following is a programming language that includes build-in
commands that mimic the functionality available from menus and dialog boxes
within an application?

A. Binary code

B. Object-oriented programming language

C. Macro language

D. HyperText Markup Language

A macro language is a programming language that includes built-in commands


that mimic the functionality available from menus and dialog boxes within an
application.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Why VBA?
6. Which of the following is a set of Excel actions recorded or written by a user?

A. A macro

B. A hyperlink

C. A botnet

D. A rootkit

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Why VBA?
7. Mr. Joseph is the CEO of a leading manufacturing concern. He wanted his name
and designation to appear in italics on all the spreadsheets of the company's
annual report. Which of the following Excel action should he use to achieve
this?

A. A wizard

B. A rootkit

C. A macro

D. A botnet

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.

AACSB: Reflective Thinking


Blooms: Apply
Learning Objective: M-02 Define a macro.
Level of Difficulty: 2 Medium
Topic: Why VBA?
8. Dan was making a science project. He wanted to automate the two steps of
adding a background theme to the cells and then printing the worksheet. Which
of the following Excel actions can help Dan achieve this?

A. A system program

B. A macro

C. A hyperlink

D. An auto function

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.

AACSB: Reflective Thinking


Blooms: Apply
Learning Objective: M-02 Define a macro.
Level of Difficulty: 2 Medium
Topic: Why VBA?
9. Which of the following statements is true about a macro in Excel?

A. It is used to access the functions available in Excel.

B. It is used to convert an Excel worksheet into a PDF document.

C. It is used to scramble the contents of an Excel worksheet so that it can't be


read without the right key.

D. It is used to automate a series of Excel steps and to set up buttons and dialog
boxes.

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.
This term means that a series of steps is completed automatically.

AACSB: Technology
Blooms: Understand
Learning Objective: M-02 Define a macro.
Level of Difficulty: 2 Medium
Topic: Why VBA?
10. Which of the following is a built-in function in Excel and does not require a
macro?

A. Inserting a company name on all spreadsheets

B. Creating a custom toolbar button

C. Performing a specific calculation on multiple workbooks

D. Computing Sum and Average

Some common uses for VBA macros: Developing new worksheet functions—
Although Excel includes numerous built-in functions (such as SUM and
AVERAGE), you can create custom worksheet functions that can greatly simplify
your formulas.

AACSB: Technology
Blooms: Understand
Learning Objective: M-02 Define a macro.
Level of Difficulty: 2 Medium
Topic: Why VBA?
11. Which of the following tools enables users to view and edit a VBA macro?

A. Web authoring software

B. Visual Basic Editor

C. Query-by-example tool

D. Visual Basic Analyzer

You perform actions in VBA by writing (or recording) code in a VBA macro. You
view and edit VBA macros using the Visual Basic Editor (VBE).

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?
12. Which of the following is a component of a macro that performs some action
on or with objects?

A. A Function procedure

B. A Sub procedure

C. A visual procedure

D. A Sub macro

A VBA macro consists of Sub procedures. A Sub procedure is computer code


that performs some action on or with objects.

AACSB: Technology
Blooms: Understand
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 2 Medium
Topic: Why VBA?
13. Which of the following is a VBA macro that returns a single value?

A. A Sub procedure

B. A Function procedure

C. An Object procedure

D. A Sub Macro

A VBA macro can also have Function procedures. A Function procedure is a VBA
macro that returns a single value.

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?
14. Which of the following is true about Function procedures?

A. Function procedures return a single value.

B. The end of a Function procedure is marked by the keyword End Sub.

C. The macro recorder can produce Function procedures.

D. Function procedures refer to one or more information statements that you


provide to VBA.

A VBA macro can also have Function procedures. A Function procedure is a VBA
macro that returns a single value.

AACSB: Technology
Blooms: Understand
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 2 Medium
Topic: Why VBA?
15. Which of the following VBA macros can be used in a worksheet formula?

A. An integrity constraint

B. An Object procedure

C. A primary key

D. A Function procedure

A VBA macro can also have Function procedures. A Function procedure is a VBA
macro that returns a single value. You can call it from another VBA macro or
even use it as a function in a worksheet formula.

AACSB: Technology
Blooms: Understand
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 2 Medium
Topic: Why VBA?
16. Which of the following does a VBA macro manipulate?

A. A constant

B. A variable

C. An object

D. A sub macro

VBA manipulates objects. An object in VBA is an item available for you to


control in your code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?
17. A(n) _____ in VBA is an item available for you to control in your code.

A. constant

B. object

C. sub macro

D. variable

VBA manipulates objects. An object in VBA is an item available for you to


control in your code. Excel provides more than 100 objects that you can
manipulate. Examples of objects include a workbook, a worksheet, a cell range,
a chart, and a shape.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?
18. Which of the following refers to a place used to store a piece of information in
Excel?

A. A cell

B. A variable

C. A macro

D. A field

You can assign values to variables. A variable is a place to store a piece of


information. You can use variables in your VBA macro to store such things as
values, text, or property settings (such as a font color or alignment).

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?
19. Which of the following keys will you press to activate the VBE when Excel is
active?

A. Ctrl+F9

B. Ctrl+V

C. Alt+F11

D. Alt+V

The quickest way to activate the VBE is to press Alt + F11 when Excel is active. To
return to Excel, press Alt + F11 again. (Alt + F11 acts as a toggle between the
Excel application interface and the VBE.)

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
20. When working on a worksheet, Ben was editing his macros using the Visual
Basic Editor (VBE). After a while he wanted to go back to the Excel application
interface. Which of the following key(s) should Ben use to toggle between the
Excel application interface and the VBE?

A. Ctrl+F9

B. Ctrl+V

C. Alt+F11

D. Alt+V

The quickest way to activate the VBE is to press Alt + F11 when Excel is active. To
return to Excel, press Alt + F11 again. (Alt + F11 acts as a toggle between the
Excel application interface and the VBE.)

AACSB: Technology
Blooms: Understand
Learning Objective: M-04 Describe an object.
Level of Difficulty: 2 Medium
Topic: The Visual Basic Editor
21. Which of the following VBA windows shows every workbook that is currently
open in Excel?

A. The Project Explorer Window

B. The Code Window

C. The Properties Window

D. The Immediate Window

The Project Explorer window displays a tree diagram that consists of every
workbook currently open in Excel.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
22. Which of the following key(s) will display the Project Explorer window if it is not
visible on the VBE Program Window?

A. Ctrl+F11

B. Ctrl+W

C. Alt+W

D. Ctrl+R

The Project Explorer window displays a tree diagram that consists of every
workbook currently open in Excel. If the Project Explorer window is not visible,
press Ctrl + R or choose View, then the Project Explorer command.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
23. Which of the following is true about the Project Explorer window?

A. It is most useful for executing VBA statements directly.

B. It contains VBA code.

C. It displays a tree diagram that consists of every workbook currently open in


Excel.

D. It shows you the properties that can be changed for the currently active
object in the Project Explorer window.

The Properties window shows you the properties that can be changed for the
currently active object in the Project Explorer window. For example, the
ScrollArea property can restrict users to that area of the worksheet.

AACSB: Technology
Blooms: Understand
Learning Objective: M-04 Describe an object.
Level of Difficulty: 2 Medium
Topic: The Visual Basic Editor
24. Which of the following VBA windows will you use to debug your VBA code?

A. The Project Explorer Window

B. The Code Window

C. The Properties Window

D. The Immediate Window

The Immediate window is most useful for executing VBA statements directly and
for debugging your code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
25. Which of the following key(s) will display the Immediate Window if it is not
visible on the VBE Program Window?

A. Ctrl+W

B. Ctrl+G

C. Alt+W

D. Ctrl+I

The Immediate window may or may not be visible. If it isn't visible, press Ctrl + G
or choose the View, then the Immediate Window command.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
26. Which of the following is true about the Immediate window?

A. It shows you the properties that can be changed for the currently active
object in the Project Explorer window.

B. It displays a tree diagram that consists of every workbook currently open in


Excel.

C. It can be displayed by pressing Ctrl + R.

D. It is most useful for executing VBA statements directly.

The Immediate window is most useful for executing VBA statements directly and
for debugging your code.

AACSB: Technology
Blooms: Understand
Learning Objective: M-04 Describe an object.
Level of Difficulty: 2 Medium
Topic: The Visual Basic Editor
27. When you record a macro, Excel automatically inserts a VBA _____ to hold the
recorded code.

A. constant

B. object

C. module

D. variable

When you record a macro, Excel automatically inserts a VBA module (by default
it is named Module1) to hold the recorded code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
28. When entering code directly into a module, which key should be used to indent
some of the lines to make the code easier to read?

A. Tab

B. Shift

C. Ctrl

D. Alt

When you are entering your code directly, you use the Tab key to indent some
of the lines to make your code easier to read.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
29. While entering a VBA code directly, to continue a single line of code from one
line to the next, end the first line with:

A. a space followed by an equal sign.

B. a continue Sub statement.

C. a space followed by an underscore.

D. a space followed by a double quote.

A single line of VBA code can become very long. Therefore, you may want to
use the line continuation character to break up lengthy lines of code. To
continue a single line of code from one line to the next, end the first line with a
space followed by an underscore (_), then continue the statement on the next
line.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
30. Sub procedures start with the keyword Sub followed by the name of the
procedure and opening and closing:

A. double quotes.

B. parentheses.

C. single quotes.

D. guillemets.

Sub procedures (sometimes referred to as subroutines) start with the keyword


Sub followed by the name of the procedure and opening and closing
parentheses.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: VBA Building Blocks
31. Which of the following statements is true of a user defined function?

A. It can be written when the function needed is already in Excel.

B. It can increase the complexity of a worksheet.

C. It can increase productivity.

D. It can be recorded in a macro recorder.

If the function you need is not already in Excel, you can write your own user
defined function (or UDF) using VBA. UDFs can reduce the complexity of a
worksheet. UDFs can increase productivity when many users have to repeatedly
use the same calculation procedures.

AACSB: Technology
Blooms: Understand
Learning Objective: M-04 Describe an object.
Level of Difficulty: 2 Medium
Topic: VBA Building Blocks
32. Which of the following is the simplest type of VBA statement?

A. A macro

B. A For-Next loop

C. An assignment

D. A comment

A comment is the simplest type of VBA statement. Because VBA ignores these
statements, they can consist of anything you want. You can insert a comment to
remind yourself why you did something or to clarify a piece of code you wrote.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
33. With which of the following would you begin a comment line?

A. A single quote

B. A double quote

C. An underscore

D. An equal sign

You begin a comment with a single quote (‘). VBA ignores any text that follows a
single quote in a line of code. You can use a complete line for your comment or
insert your comment at the end of a line of code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
34. Which of the following elements of VBA programming may change during the
execution of a procedure?

A. A constant

B. A variable

C. A comment

D. A macro

A variable's value may (and usually does) change while your procedure is
executing.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
35. Which of the following would be considered a named element whose value
would not change during the execution of a procedure?

A. A variable

B. A constant

C. A comment

D. A macro

Sometimes, you need to refer to a value or string that never changes, in other
words, a constant. A constant is a named element whose value doesn't change.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
36. Which of the following data type uses 2 bytes and whose range of values is true
or false?

A. Boolean

B. Integer

C. Double (negative)

D. Double (positive)

There are many different data types that are used in Visual Basic Applications.
Boolean data type uses 2 bytes and its range of values is true or false.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
37. Which of the following data type uses 1 byte per character and whose range of
values varies?

A. Boolean

B. String

C. Integer

D. Currency

There are many different data types that are used in Visual Basic Applications.
String data type uses 1 byte per character and its range of values varies.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
38. Excel and VBA can work with both numbers and text. Text is often referred to as
____.

A. a variable

B. an object

C. a string

D. a subroutine

Excel and VBA can work with both numbers and text. Text is often referred to as
a string.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

39. What type of strings theoretically can hold as many as 2 billion characters?

A. Recurring-length strings

B. Definite-length strings

C. Fixed-length strings

D. Variable-length strings

Variable-length strings theoretically can hold as many as 2 billion characters.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

40. Which of the following options would describe the process of creating variables
simply by using them?

A. Definite variable declaration

B. Implicit variable declaration

C. Explicit variable declaration

D. Composite variable declaration

Creating variables simply by using them is referred to as implicit variable


declaration.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
41. Which of the following describes the process of defining the names of all the
variables you are going to use, before you use them in your code?

A. Definite variable declaration

B. Precision variable declaration

C. Explicit variable declaration

D. Implicit variable declaration

Most computer languages require us to employ explicit variable declaration.


This means that you must define the names of all the variables you are going to
use, before you use them in your code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
42. Which of the following is used to declare an explicit variable with VBA code?

A. A Dim statement

B. A comment

C. An assignment statement

D. A string

If you want to declare a variable explicitly, you do so using a Dim statement.


When declaring a string variable with a Dim statement, you can specify the
maximum length if you know it (it's a fixed-length string) or let VBA handle it
dynamically (it's a variable length string).

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
43. In VBA, dates and times are placed between two:

A. ~ symbols.

B. # symbols.

C. * symbols.

D. " symbols.

In VBA, dates and times are placed between two hash marks, i.e., the # symbols.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

44. Which of the following is a VBA statement that allocates the result of an
expression to a variable or an object?

A. A Dim statement

B. A function statement

C. An assignment statement

D. A detail statement

An assignment statement is a VBA statement that assigns the result of an


expression to a variable or an object.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

45. In VBA, which of the following symbols represents the exponentiation operator?

A. ^

B. *

C. /

D. &

The exponentiation operator is represented by the symbol ^.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
46. In VBA, which of the following logical operators performs the function of
conjunction on two expressions?

A. And

B. Eqv

C. XoR

D. Imp

The logical operator And performs the function of conjunction on two


expressions.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
47. In VBA, which of the following logical operators performs the function of
disjunction on two expressions?

A. Not

B. Or

C. And

D. XoR

The logical operator Or in VBA performs the function of negation on an


expression.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
48. In VBA, which of the following logical operators performs the function of
exclusion on two expressions?

A. And

B. Eqv

C. XoR

D. Imp

The logical operator Xor in VBA performs the function of negation on an


expression.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
49. In VBA, which of the following logical operators performs the function of
negation on an expression?

A. XoR

B. Or

C. Imp

D. Not

The logical operator Not in VBA performs the function of negation on an


expression.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
50. Which of the following operators has the highest precedence in VBA?

A. Division

B. Addition

C. Multiplication

D. Exponentiation

The precedence order for operators in VBA is exactly the same as in Excel
formulas. Exponentiation has the highest precedence. Multiplication and division
come next, followed by addition and subtraction.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
51. Which of the following is true about the way a macro works?

A. It skips over some statements as it executes the code

B. It executes some statements multiple times

C. It tests conditions to determine what the procedure does next

D. It starts at the code's beginning and progresses line by line to the end

Some VBA procedures start at the code's beginning and progress line by line to
the end, never deviating from this top-to-bottom flow. Macros that you record
always work like this.

AACSB: Technology
Blooms: Understand
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 2 Medium
Topic: Decisions, Decisions, Decisions
52. Which of the following statements is VBA's most important control structure?

A. For-Next

B. If-Then

C. Do-Until

D. Do-While

The If-Then statement is VBA's most important control structure. Use the If-Then
structure when you want to execute one or more statements conditionally.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
53. When you want to execute one or more statements conditionally, what VBA
structure would you use?

A. If-Then

B. Do-While

C. For-Next

D. Do-Until

Use the If-Then structure when you want to execute one or more statements
conditionally.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
54. Which of the following VBA structures is recommended in a decision involving
three or more options?

A. If-Then

B. Select-Case

C. Looping

D. Do-While

The Select Case structure is useful for decisions involving three or more options
(although it also works with two options, providing an alternative to the If-Then
structure).

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
55. When VBA executes a Select Case structure, the structure is exited:

A. as soon as VBA finds a true case.

B. after VBA executes the statements for a true condition.

C. after VBA executes the statements for a false condition.

D. as soon as VBA finds a false case.

When VBA executes a Select Case structure, the structure is exited as soon as
VBA finds a true case.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
56. Which of the following terms refers to repeating a block of statements or code
numerous times?

A. Redacting

B. Linking

C. Looping

D. Concatenating

The term looping refers to repeating a block of statements or code numerous


times. You may know how many times your macro needs to loop, or variables
used in your programs may determine this.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
57. Which of the following is the simplest type of looping statement?

A. Do-While

B. Do-Else

C. Do-Until

D. For-Next

The simplest type of loop is a For-Next loop. The looping is controlled by a


counter variable, which starts at one value and stops at another value. The
statements between the For statement and the Next statement are the
statements that get repeated in the loop.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
58. Which VBA loop structure is controlled by a counter variable, which starts at one
value and stops at another value?

A. For-Next

B. Do-Until

C. Do-While

D. Else

The simplest type of loop is a For-Next loop. The looping is controlled by a


counter variable, which starts at one value and stops at another value. The
statements between the For statement and the Next statement are the
statements that get repeated in the loop.

AACSB: Technology
Blooms: Understand
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 2 Medium
Topic: Decisions, Decisions, Decisions
59. In which of the following VBA structures, a macro continues to execute the loop
until a specified condition is met?

A. For-Next loop

B. If-Then loop

C. Do-While loop

D. Do-Next loop

VBA supports another type of looping structure known as a Do-While loop.


Unlike a For-Next loop, a Do-While loop continues until a specified condition is
met.

AACSB: Technology
Blooms: Understand
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 2 Medium
Topic: Decisions, Decisions, Decisions
60. Which of the following is true about the Do-Until loop structure?

A. In a Do-Until loop, the macro executes the loop until the condition is false.

B. A Do-Until loop continues until a specified condition is met.

C. A Do-Until loop is the simplest type of loop.

D. A Do-Until loop is similar to the Do-While structure.

The Do-Until loop structure is similar to the Do-While structure. The two
structures differ in their handling of the tested condition. A macro continues to
execute a Do-While loop while the condition remains true. In a Do-Until loop,
the macro executes the loop until the condition is true.

AACSB: Technology
Blooms: Understand
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 2 Medium
Topic: Decisions, Decisions, Decisions

True / False Questions


61. VBA stands for Virtual Basic for Applications.

FALSE

VBA, which stands for Visual Basic for Applications, is a programming language
developed by Microsoft. Excel, along with the other members of Microsoft
Office, includes the VBA language.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction

62. Units of VBA code are called subroutines.

FALSE

Units of VBA code are often referred to as macros. Although this module covers
more formal terminology, the term macro will be used as a general way to refer
to any VBA code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Introduction
63. To use VBA in an Excel worksheet, you must purchase a separate plug-in
module.

FALSE

It is not essential to make a further software purchase in order to learn the


elements of Visual Basic programming. Excel VBA comes free with Excel (97,
2000, 2002, 2003, etc.) and provides a great deal of the functionality.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction

64. The macro recorder is a software tool that lets you record a sequence of
commands in Excel and save them as a macro.

TRUE

The macro recorder is a software tool that lets you record a sequence of
commands in Excel and save them as a macro. This is invaluable if you are
struggling with some programming syntax. Just get the recorder to do it for you
and then view the code to see how it is done.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction
65. VBA is only a programming language and not a macro language.

FALSE

VBA is a programming language, but it also serves as a macro language. A


macro language is a programming language that includes built-in commands
that mimic the functionality available from menus and dialog boxes within an
application.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Why VBA?

66. A macro is a set of actions recorded or written by a user.

TRUE

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.
This term means that a series of steps is completed automatically.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Why VBA?
67. You can use VBA to create your own worksheet functions.

TRUE

You can use VBA to create your own worksheet functions. If you have a complex
calculation that you use frequently that is not included in the set of standard
Excel functions (such as a tax calculation or a specialized scientific formula), you
can write your own user-defined function.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Why VBA?

68. A VBA macro can be used to print your company name and logo at the top of
all worksheets.

TRUE

A common use of VBA macros is automating repetitive tasks—if you need to


perform the same action on 12 different Excel workbooks, you can record a
macro while you perform the task on the first workbook and then let the macro
repeat your action on the other workbooks.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Why VBA?
69. You can customize the Excel toolbars with your own buttons that execute the
macros you write.

TRUE

A common use of VBA macros is creating a custom toolbar button where you
can customize the Excel toolbars with your own buttons that execute the macros
you write.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Why VBA?

70. The Visual Basic Editor is used to record a sequence of commands in Excel to
save them in a macro.

FALSE

You perform actions in VBA by writing (or recording) code in a VBA macro. You
view and edit VBA macros using the Visual Basic Editor (VBE).

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?
71. A Sub procedure is a VBA macro that returns a single value.

FALSE

A Sub procedure is computer code that performs some action on or with


objects.

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?

72. You view and edit VBA macros using the Function procedure.

FALSE

A VBA macro can also have Function procedures. A Function procedure is a VBA
macro that returns a single value.

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?
73. A variable in VBA is an item available for you to control in your code.

FALSE

A variable is a place to store a piece of information. You can use variables in


your VBA macro to store such things as values, text, or property settings (such
as a font color or alignment).

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?

74. Excel must be running before a VBA macro can be edited using the VB editor.

TRUE

You can't run the VBE separately; Excel must be running in order for the VBE to
operate.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
75. The quickest way to activate the VBE is to press Ctrl + F11 when Excel is active.

FALSE

The quickest way to activate the VBE is to press Alt + F11 when Excel is active.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

76. If the Project Window is not visible in VBE, press the Ctrl + W to open it.

FALSE

If the Project Explorer window is not visible, press Ctrl + R or choose View, then
the Project Explorer command.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
77. When working in VBE, an object is considered as a collection of projects.

FALSE

When you're working in the VBE, each Excel workbook that's open is a project.
You can think of a project as a collection of objects arranged as an outline.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

78. A single VBA module can store any number of Sub procedures, Function
procedures, and declarations.

TRUE

A single VBA module can store any number of Sub procedures, Function
procedures, and declarations. How you organize a VBA module is completely up
to you. Some people prefer to keep all their VBA code for an application in a
single VBA module; others like to split up the code into several different
modules.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
79. When typing code directly into a VBA macro, the Ctrl key is used to indent some
of the lines to make the code easier to read.

FALSE

When you are entering your code directly, you use the Tab key to indent some
of the lines to make your code easier to read.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

80. When saving an Excel workbook, any macro that has been created will
automatically get saved within the workbook.

TRUE

When you save an Excel workbook, any macro that you have created
automatically gets saved within the workbook, so there is nothing different or
new you need to do other than clicking on File, Save.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
81. Excel's VBA macro recorder makes it easy to record user defined functions.

FALSE

Unlike manual operations, user defined functions (UDFs) cannot be recorded.


You have to write them from scratch using a standard module in the VBE.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: VBA Building Blocks

82. A variable is the simplest type of VBA statement.

FALSE

A comment is the simplest type of VBA statement. Because VBA ignores these
statements, they can consist of anything you want. You can insert a comment to
remind yourself why you did something or to clarify a piece of code you wrote.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
83. In a VBA statement, a comment begins with a double quote (").

FALSE

You begin a comment with a single quote (‘). VBA ignores any text that follows a
single quote in a line of code. You can use a complete line for your comment or
insert your comment at the end of a line of code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

84. To assign a value to a variable, you must use the equal sign operator.

TRUE

You have lots of flexibility in naming your variables, so make the variable names
as descriptive as possible. You assign a value to a variable using the equal sign
operator.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
85. It is permissible to use spaces when assigning variable names.

FALSE

VBA enforces a few rules regarding variable names of which one is that you
cannot use any spaces or periods in a variable name.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

86. Excel and VBA can work with both numbers and text.

TRUE

Excel and VBA can work with both numbers and text. Text is often referred to as
a string.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
87. Variable-length strings theoretically can hold as many as 2 billion characters.

TRUE

Variable-length strings theoretically can hold as many as 2 billion characters.


Whereas Fixed-length strings are declared with a specified number of characters
(the maximum length is about 65,526 characters).

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

88. An assignment statement is a VBA statement that assigns the result of an


expression to a variable or an object.

TRUE

An assignment statement is a VBA statement that assigns the result of an


expression to a variable or an object.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
89. The operator XoR performs the logical inclusion on an expression.

FALSE

The operator XoR performs the logical exclusion on two expressions.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

90. A macro is a VBA procedure that starts executing the code at the beginning and
progresses line by line until it reaches the end.

TRUE

Some VBA procedures start at the code's beginning and progress line by line to
the end, never deviating from this top-to-bottom flow. Macros that you record
always work like this.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
91. The Select Case structure is used for decisions involving 2 options.

TRUE

The Select Case structure is useful for decisions involving three or more options
(although it also works with two options, providing an alternative to the If-Then
structure).

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

92. The term looping refers to repeating a block of statements or code numerous
times.

TRUE

The term looping refers to repeating a block of statements or code numerous


times. You may know how many times your macro needs to loop, or variables
used in your programs may determine this.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions
93. In a Do-While loop, the macro executes the loop until the condition is true.

FALSE

A macro continues to execute a Do-While loop while the condition remains true.
In a Do-Until loop, the macro executes the loop until the condition is true.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

Fill in the Blank Questions


94. _____ extends and customizes Excel, allowing you to do things that Excel itself is
not able to do, such as calculating values in cells based on user input values.

Visual Basic for Applications

VBA, which stands for Visual Basic for Applications, is a programming language
developed by Microsoft. Excel, along with the other members of Microsoft
Office, includes the VBA language. VBA extends and customizes Excel, allowing
you to do things that Excel itself is not able to do, such as calculating values in
cells based on user input values.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction

95. Units of VBA code are called ____.

macros

Units of VBA code are often referred to as macros. Although this module covers
more formal terminology, the term macro will be used as a general way to refer
to any VBA code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Introduction
96. The _____ is a software tool that lets you record a sequence of commands in
Excel and save them as a macro.

macro recorder

The macro recorder is a software tool that lets you record a sequence of
commands in Excel and save them as a macro. This is invaluable if you are
struggling with some programming syntax. Just get the recorder to do it for you
and then view the code to see how it is done.

AACSB: Technology
Blooms: Remember
Learning Objective: M-01 Explain the value of using VBA with Excel.
Level of Difficulty: 1 Easy
Topic: Introduction

97. A(n) _____ is a set of actions recorded or written by a user.

macro

A macro is a set of actions recorded or written by a user. For instance, you can
create a macro that always prints your name in bold on a spreadsheet. You can
name it PrintName and then reuse the PrintName macro in any spreadsheet.
This term means that a series of steps is completed automatically.

AACSB: Technology
Blooms: Remember
Learning Objective: M-02 Define a macro.
Level of Difficulty: 1 Easy
Topic: Why VBA?

98. A(n) _____ is a set of programming instructions that performs some action on or
with objects.

Sub procedure

A VBA macro consists of Sub procedures. A Sub procedure is computer code


that performs some action on or with objects.

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?

99. A(n) _____ is a VBA macro that returns a single value.

Function procedure

A VBA macro can also have Function procedures. A Function procedure is a VBA
macro that returns a single value. You can call it from another VBA macro or
even use it as a function in a worksheet formula.

AACSB: Technology
Blooms: Remember
Learning Objective: M-03 Build a simple macro using a Sub procedure and a Function procedure.
Level of Difficulty: 1 Easy
Topic: Why VBA?
100. Visual Basic for Applications (VBA) manipulates ____, such as a workbook, a
worksheet, a cell range, a chart, or a shape.

objects

VBA manipulates objects. An object in VBA is an item available for you to


control in your code. Objects include a workbook, a worksheet, a cell range, a
chart, and a shape.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?

101. A(n) _____ can be used in VBA macro to store such things as values, text, or
property settings (such as a font color or alignment).

variable

You can assign values to variables. A variable is a place to store a piece of


information. You can use variables in your VBA macro to store such things as
values, text, or property settings (such as a font color or alignment).

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: Why VBA?
102. The _____ is a separate application where you write and edit your Visual Basic
macros.

Visual Basic Editor

The Visual Basic Editor (VBE) is a separate application where you write and edit
your Visual Basic macros. You can't run the VBE separately; Excel must be
running in order for the VBE to operate.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

103. The quickest way to activate the Visual Basic Editor (VBE) is to press _____ when
Excel is active.

Alt + F11

The quickest way to activate the VBE is to press Alt + F11 when Excel is active. To
return to Excel, press Alt + F11 again. (Alt + F11 acts as a toggle between the
Excel application interface and the VBE.)

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
104. In the Visual Basic Editor (VBE), the _____ window displays a tree diagram that
consists of every workbook currently open in Excel.

Project Explorer

The Project Explorer window displays a tree diagram that consists of every
workbook currently open in Excel.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

105. The _____ window is most useful for executing VBA statements directly and for
debugging code.

Immediate

The Immediate window is most useful for executing VBA statements directly and
for debugging your code.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
106. When you're working in the Visual Basic Editor (VBE), each Excel workbook that's
open is known as a(n) ____.

project

When you're working in the VBE, each Excel workbook that's open is a project
which is a collection of objects arranged as an outline.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor

107. _____ is a type of code which consists of one or more statements that you
provide to VBA.

Declaration

A VBA module can hold several types of code. Declarations are one or more
information statements that you provide to VBA.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: The Visual Basic Editor
108. All macros reside in code modules of which there are two types: _____ and _____
modules.

standard; class

All macros reside in code modules. There are two types of code modules: (1)
standard modules and (2) class modules.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: VBA Building Blocks

109. The macro recorder can only produce _____ procedures.

Sub

In VBA, macros are referred to as procedures. There are two types of


procedures—(1) Sub procedures and (2) Function procedures. The macro
recorder can produce only Sub procedures.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: VBA Building Blocks
110. If the function you need is not already in Excel, you can write your own _____
using VBA.

user defined function

If the function you need is not already in Excel, you can write your own user
defined function (or UDF) using VBA. UDFs can reduce the complexity of a
worksheet.

AACSB: Technology
Blooms: Remember
Learning Objective: M-04 Describe an object.
Level of Difficulty: 1 Easy
Topic: VBA Building Blocks

111. A(n) _____ is the simplest type of VBA statement.

comment

A comment is the simplest type of VBA statement. Because VBA ignores these
statements, they can consist of anything you want. You can insert a comment to
remind yourself why you did something or to clarify a piece of code you wrote.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
112. To assign a value to a variable, you must use the _____ operator.

equal sign

You assign a value to a variable using the equal sign operator. You have lots of
flexibility in naming your variables, so make the variable names as descriptive as
possible.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

113. When assigning variable names, you can use letters, numbers, and some
punctuation characters, but the first character must be a(n) ____.

letter

VBA enforces a few rules regarding variable names, of which one is that you can
use letters, numbers, and some punctuation characters, but the first character
must be a letter.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
114. In the context of the elements of VBA programming, a(n) _____ is a named
element whose value doesn't change.

constant

A variable's value may (and usually does) change while your procedure is
executing. Sometimes, you need to refer to a value or string that never changes,
in other words, a constant. A constant is a named element whose value doesn't
change.

AACSB: Technology
Blooms: Remember
Learning Objective: M-05 Explain the difference between a comment; a variable; and a constant.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

115. A(n) _____ data type uses 2 bytes and its range of values is True or False.

Boolean

Data types are the manner in which data types are stored in memory—for
example, as integers, real numbers, or strings. VBA has a variety of built-in data
types. A Boolean data type uses 2 bytes and its range of values is true or false.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
116. Excel and Visual Basic for Applications (VBA) can work with both numbers and
text. Text is often referred to as a(n) ____.

string

Excel and VBA can work with both numbers and text. Text is often referred to as
a string.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

117. In VBA, _____ are declared with a specified number of characters.

fixed-length strings

Excel and VBA can work with both numbers and text. Text is often referred to as
a string. Fixed-length strings are declared with a specified number of characters.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
118. If you want to declare a variable explicitly, you do so using a _____ statement.

Dim

If you want to declare a variable explicitly, you do so using a Dim statement.


When declaring a string variable with a Dim statement, you can specify the
maximum length if you know it (it's a fixed-length string) or let VBA handle it
dynamically (it's a variable length string).

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

119. A(n) _____ is a VBA statement that assigns the result of an expression to a
variable or an object.

assignment statement

An assignment statement is a VBA statement that assigns the result of an


expression to a variable or an object.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming
120. In the context of the precedence order for operators in VBA, _____ has the
highest precedence.

exponentiation

Operators play a major role in VBA. The precedence order for operators in VBA
is exactly the same as in Excel formulas. Exponentiation has the highest
precedence. Multiplication and division come next, followed by addition and
subtraction.

AACSB: Technology
Blooms: Remember
Learning Objective: M-06 List the various Visual Basic Application data types and operators.
Level of Difficulty: 1 Easy
Topic: Elements of VBA Programming

121. Some Visual Basic for Applications (VBA) procedures, such as ____, always start
at the code's beginning and progress line by line to the end, never deviating
from this top-to-bottom flow.

macros

Some VBA procedures start at the code's beginning and progress line by line to
the end, never deviating from this top-to-bottom flow. Macros that you record
always work like this.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

122. In the context of the standard structured decision offered by VBA, the _____
structure is suggested for decisions involving three or more options.

Select Case

The Select Case structure is useful for decisions involving three or more options
(although it also works with two options, providing an alternative to the If-Then
structure).

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

123. The term _____ refers to repeating a block of statements or code numerous
times.

looping

The term looping refers to repeating a block of statements or code numerous


times. You may know how many times your macro needs to loop, or variables
used in your programs may determine this.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

124. A(n) _____ loop continues to execute until a specified condition has been met.

Do-While

VBA supports another type of looping structure known as a Do-While loop.


Unlike a For-Next loop, a Do-While loop continues until a specified condition is
met.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

125. In a _____ loop, the macro executes the loop until the condition is true.

Do-Until

The Do-Until loop structure is similar to the Do-While structure. The two
structures differ in their handling of the tested condition. A macro continues to
execute a Do-While loop while the condition remains true. In a Do-Until loop,
the macro executes the loop until the condition is true.

AACSB: Technology
Blooms: Remember
Learning Objective: M-07 Describe and build a macro that uses the If-Then-Else; For-Next; Do-Until; Do-While; and Select Case
structures.
Level of Difficulty: 1 Easy
Topic: Decisions, Decisions, Decisions

Das könnte Ihnen auch gefallen