vba linkedin assessment answers
1. Which statement prints the value of the variable x in the Immediate window?
- Debug.Print X
- Print X
- Watch.Value X
- Immediate = X
4. Which statement causes the procedure DoItAgain to run one hour after the statement is executed?
5. How does a class module indicate that it uses a particular interface?
- by means of the Implements keyword and the name of the interface
- The name of the interface is passed as a parameter.
- by means of the Interface keyword and the name of the interface
- The interface itself is part of the class module.
6. You want to make another Office application's object model accessible First you open the Visual Basic Editor. Where do you go next?
- Insert > Class Module
- Tools > References
- View > Object Browser
- Add-ins
7. Where is the event procedure named Worksheet_Change found?
- in the worksheet’s object module
- in the Worksheet_Change class module
- in any standard code module
- in the workbook’s code module
8. SubA passes MyVar to SubB. How can you ensure that MyVar has its original value when control returns to SubA?
- Declare SubB as Sub SubB(MyVar)
- Declare SubB as Sub SubB (ByRef MyVar).
- Declare SubB as Sub SubB(ByVal MyVar).
- Declare SubB as Sub Sub(Static MyVar).
9. Which part of the VBE can help you explore VBA syntax?
- Obiect Browser
- Project Explorer
- Optional dialog
- Locals window
10. What does this code return as the value of Total?
Sub UseSum( )
Dim TestArray( ) As Integer, Total As Integer
ReDim TestArray(1)
TestArray(1) = 6
ReDim TestArray(2)
TestArray(2) = 3
Total = WorksheetFunction.Sum(TestArray)
End Sub
- 6
- 0
- 9
- 3
11. 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 0 columns
- 1 row and 10 columns
- 10 rows and 1 column
12. A VBA project must declare four classes. How many class modules are needed?
- as many as are required by the variable types that the objects return
- one (each class is declared in the same module)
- four (one for each class)
- two (one for the properties and one for the methods)
13. When you define a new class of object, where do you assign a name to it?
- in the class module’s code
- in a standard module’s code
- in a standard module’s Properties
- in the class module’s name
14. In Excel, what is the effect of the two statements below?
Range ("b3:f5, c4:d9") . Select
Range ("b3: f5",
"c4: d9"). Select
- The first gives a run-time error: “Method Range of object Global failed.”
- The first selects two ranges, B3:F5 and C4:D9. The second selects the rectangular range B3:F9.
- In both cases, a rectangular range B3:F9 is selected.
- In both cases, two ranges are selected: B3:F5 and C4:D9.
15. The Driver subroutine is declared by Sub Driver (Y). Which statement results in a compile error?
- Call Driver(X)
- Call Driver X
- Driver X
- Driver (X)