Questions and Answers
- Which two sets of values are printed by this function and sub?
- [ ]
- [x]
- [ ]
- [ ]
- This code shows the first statement of CalledSub. Which calling statement will work properly?
- call Calledsub "smith",26
- calledsub (surname="smith", Age = 26)
- calledsub (Surname:="Smith", Age:=26)
- calledsub "smith", 26
- What is the principal difference between a class and an object?
- There is no meaningful difference. The terms are used interchangeably.
- A dass declares an object's properties. An object completes the declaration by defining events and methods.
- An object is a template for a class.
- A class describes the design of an object. An object is an instance of that design.
- What value does the MsgBox statement display?
- 2
- 10
- First arg
- 3.1416
- What object is needed to put a userform module in a VBA project?
- associated standard code module
- UserForm
- associated class module
- userForm class
- What is the output?
- 3
- 0
- 9
- 6
- The Driver subroutine is declared by Sub Driver (Y). Which statement results in a compile error?
- Driver x
- call Driver(x)
- call Driver x
- Driver (X)
- You have several variables to display on a user form, and there are too many variables to display at once. Which control best enables the user to see all the variables?
- Frame
- multipage
- TabStrip
- ListBox
- Below is a function named SquareIt. Which version of the subroutine named Area results in a compile error?
- sub Area()
- Sub Area()
- EmailAddress() is an array. It is declared by Dim EmailAddress(10) As String, and option Base 1 is in effect. How many rows and columns are in EmailAddress()?
- 10 rows and 10 columns
- 10 rows and 1 column
- 10 rows and 0 columns
- 1 row and 10 columns
- Which cell is selected if you run this code?
- F5
- F3
- B3
- E3
- Which variable name is valid in VBA?
- `_MyVar`
- `My_Var`
- `My-Var`
- `1MyVar`
- Which is a valid definition of a user-defined data type?
- [x]
- [ ]
- [ ]
- [ ]
- The recording of a macro in Word is likely to be an incomplete record of the user's actions. Why?
- Word's Macro Recorder does not record actions initiated by keyboard shortcuts.
- Word's Macro Recorder does not support Find & Replace edits.
- Word's Macro Recorder does not record actions initiated by clicking a button on the Ribbon's Developer tab.
- Word's Macro Recorder does not record actions that inlove selection of text by pointing with the mouse pointer.
- Which statement should precede a subroutuine's error handler?
- End
- Return
- Exit Sub
- Stop
- How many values can MyArray hold?
- 0
- 32,769
- 5
- 6
- Which statement is true?
- Set establishes a value in a class; Let returns a value from a class.
- Let establishes a value in a class; Set returns a value from a class.
- Let establishes a value in a class; Get returns a value from a class.
- Get establishes a value in a class; Set returns a value from a class.
- A declaration has scope, which has three levels. What are they?
- Module, Project and Automation
- Procedure, Private Module and Public Module
- Subroutine, Module and Project
- Procedure, Project and Global
- There are two references that must be selected in the Visual Basic Editor in order for any Visual Basic code to run in Excel. What are these two references?
- MS Excel object library and MS Office object library
- VBA and MS Office object library
- VBA and Excel object library
- MS Excel object library and OLE automation
- Which action will cause your project to reset its variables?
- Edit the list of arguments of the current routine while in debug mode.
- Click End in a run-time error dialog.
- Add an ActiveXcontrol to a worksheet.
- all of these answers
- Which keyboard shortcut causes VBE to locate the declaration of a procedure?
- Shift+F3
- Alt+F (Windows) or Option+F (Mac)
- Shift+F2
- Ctrl+F (Windows) or Command+F (Mac)
- When you define a new class of object, where do you assign a name to it?
- in the class module's name
- in the class module's code
- in a standard module's code
- in a standard module's Properties
- How does a class module indicate that it uses a particular interface?
- The interface itself is part of the class module.
- by means of the Interface keyword and the name of the interface
- by means of the Implements keyword and the name of the interface
- The name of the interface is passed as a parameter.
- What is needed for the contents of Module1 to be availble to other modules in a VBA project, but not to any other VBA project?
- Set Option Global at the top of Module1
- Declare module-level variables as Private
- Set Module Level Scope at the top of Module1
- Set Option Private Module at the top of Module1
- When used with an array named MyArray, what is the preerred way to set beginning and ending values of a loop control variable?
- For i = 0 To UBound(MyArray,1)
- For i = 1 To UBound(MyArray,1)
- For i = LBound(MyArray,1) To UBound(MyArray,1)
- It depends on whether Option Base 0 or Option Base 1 is in use.
- What is the value of Test3?
- 0
- 1
- 3
- 2
- Which statement declares an array?
- Dim MyArray() As Integer
- Dim MyArray() As Array
- Dim MyArray As Integer
- Dim MyArray As Array
- To use VBA code to maintain a different VBA project, you can make use of VBA's extensibility. What is needed to enable extensibility?
- Set Macro Security to Trust Access to the VBA Project Object Model
- The project's workbook should be protected in the Ribbon's Review tab
- Include a reference to Microsoft VBA Extensibility 5.3
- Include a reference to Microsoft VBA Extensibility 5.3 and set Macro Security to Trust Access to the VBA Project Object Model
- Explicit variable declaration is required. MyVar is declared at both the module and the procedure level. What is the value of MyVar after first AAA() and then BBB() are run?
- MyVar equals "Procedure AAA Scope"
- ISNULL(MyVar) is TRUE
- MyVar equals "Procedure BBB Scope"
- MyVar is NULL
- Which code block from class modules returns a compile error?
- [ ]
- [ ]
- [ ]
- [x]
- If VBA code declares FileCount as a constant rather than a variable, the code tends to run faster. Why is this?
- The scope of constants is limited to the procedure that declares them
- Constants are declared at compile time, but variables are declared at run time
- Once declared in a project, the value of a constant cannot be changed. There is no need to look up the current value of FileCount when it is a constant.
- The Const declaraton specifies the most efficient type given the constant's value
- A VBA project must declare four classes. How many class modules are needed?
- two (one for the properties and one for the methods)
- one (each class is declared in the same module)
- four (one for each class)
- as many as are required by the variable types that the objects return
- What does this code display?
- an error message
- Y and Z
- Z = in a message box and then a subsequent error message
- Y = in a message box and then a subsequent error message
- The VBA code block shown in the following four options runs when UserForm1's CommandButton1 button is clicked. Which block of code leaves UserFrom1 loaded but not visible until the FoundErrors function has checked it, and then enables processing to continue if no errors are found?
- [ ]
- [ ]
- [x]
- [ ]