Function GetVitals(ID As Long, Age As Long, Optional Weight As Long) As String GetVitals="ID=" & ID &"Age=" & Age & "Weight=" & Weight End Function Sub ShowVitals() Dim ID As Long, Age As Long,Weight as Long Debug.Print GetVitals(ID:=5,Age:=20) Debug.Print GetVitals(ID:=6,Age:=25,Weight:=130) End Sub ID=5 Age = 20 Weight= ID=6 Age = 25 Weight=130 ID=5 Age = 20 Weight=0 ID=6 Age = 25 Weight=130 ID=5 Age = 20 Weight=Null ID=6 Age = 25 Weight=130 ID=5 Age = 20 ID=6 Age = 25 Weight=130
1.
ID=5 Age = 20 Weight=
ID=6 Age = 25 Weight=130
2.
ID=5 Age = 20 Weight=0
ID=6 Age = 25 Weight=130
3.
ID=5 Age = 20 Weight=Null
ID=6 Age = 25 Weight=130
4.
ID=5 Age = 20
ID=6 Age = 25 Weight=130
Q 1 / 36
`Sub CalledSub(Surname, Age)`
1.
call Calledsub "smith",26
2.
calledsub (surname="smith", Age = 26)
3.
calledsub (Surname:="Smith", Age:=26)
4.
calledsub "smith", 26
Q 2 / 36
1.
There is no meaningful difference. The terms are used interchangeably.
2.
A dass declares an object's properties. An object completes the declaration by defining events and methods.
3.
An object is a template for a class.
4.
A class describes the design of an object. An object is an instance of that design.
Q 3 / 36
Sub MySub(VarA As Long, ParamArray VarB() As Variant) MsgBox VarB(0) End Sub Sub ShowValue() Call MySub(10, "First arg", 2, 3.1416) End Sub
1.
2
2.
10
3.
First arg
4.
3.1416
Q 4 / 36
1.
associated standard code module
2.
UserForm
3.
associated class module
4.
userForm class
Q 5 / 36
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
1.
3
2.
0
3.
9
4.
6
Q 6 / 36
1.
Driver x
2.
call Driver(x)
3.
call Driver x
4.
Driver (X)
Q 7 / 36
1.
Frame
2.
multipage
3.
TabStrip
4.
ListBox
Q 8 / 36
Function SquareIt(ByRef Basis As Integer) As Long SquareIt = Basis ^ 2 End Function Dim Result As Long, Side As Integer Side = 5 Result = Squarelt(Side) End Sub Dim Result As Long, Side Side = 5 Result = SquareIt(Cint(Side)) End Sub
1.
sub Area()
2.
Sub Area()
Q 9 / 36
1.
10 rows and 10 columns
2.
10 rows and 1 column
3.
10 rows and 0 columns
4.
1 row and 10 columns
Q 10 / 36
`Range("E3:312").Range("B3").Select`
1.
F5
2.
F3
3.
B3
4.
E3
Q 11 / 36
`Use the following rules when you name procedures, constants, variables, and arguments in a Visual Basic module: You must use a letter as the first character. You can't use a space, period (.), exclamation mark (!), or the characters @, &, $, # in the name. Name can't exceed 255 characters in length.`
1.
`_MyVar`
2.
`My_Var`
3.
`My-Var`
4.
`1MyVar`
Q 12 / 36
Type CBC Name As String Next As String End Type Type CBC Name As String _Next As String End Type Type CBC Name As String @Option As String End Type Type CBC Name As String %For As String End Type
1.
undefined
2.
undefined
3.
undefined
4.
undefined
Q 13 / 36
1. Save and close the project with the existing user form. 2. Click Insert > File. 3. Browse to the location of the existing project. 4. Right-click it and select the user-form you want to duplicate. 1. Open the existing user form in Desing Mode. 2. Right-click the form and select Copy. 3. Switch to the other project. 4. Right-click Module and select Paste. 1. In the Project Explorer, right-click the user form and select Copy. 2. Switch to the new project. 3. Right-click UserForms and select Paste. 1. Open the existing user form in Design Mode. 2. Click File > Export File. 3. Switch to the other project. 4. Click File > Import File.
1.
undefined
2.
undefined
3.
undefined
4.
undefined
Q 14 / 36
1.
Word's Macro Recorder does not record actions initiated by keyboard shortcuts.
2.
Word's Macro Recorder does not support Find & Replace edits.
3.
Word's Macro Recorder does not record actions initiated by clicking a button on the Ribbon's Developer tab.
4.
Word's Macro Recorder does not record actions that inlove selection of text by pointing with the mouse pointer.
Q 15 / 36
1.
End
2.
Return
3.
Exit Sub
4.
Stop
Q 16 / 36
Option Base 0 Sub BuildArray() Dim MyArray(5) As Integer
1.
0
2.
32,769
3.
5
4.
6
Q 17 / 36
1.
Set establishes a value in a class; Let returns a value from a class.
2.
Let establishes a value in a class; Set returns a value from a class.
3.
Let establishes a value in a class; Get returns a value from a class.
4.
Get establishes a value in a class; Set returns a value from a class.
Q 18 / 36
1.
Module, Project and Automation
2.
Procedure, Private Module and Public Module
3.
Subroutine, Module and Project
4.
Procedure, Project and Global
Q 19 / 36
1.
MS Excel object library and MS Office object library
2.
VBA and MS Office object library
3.
VBA and Excel object library
4.
MS Excel object library and OLE automation
Q 20 / 36
1.
Edit the list of arguments of the current routine while in debug mode.
2.
Click End in a run-time error dialog.
3.
Add an ActiveXcontrol to a worksheet.
4.
all of these answers
Q 21 / 36
1.
Shift+F3
2.
Alt+F (Windows) or Option+F (Mac)
3.
Shift+F2
4.
Ctrl+F (Windows) or Command+F (Mac)
Q 22 / 36
1.
in the class module's name
2.
in the class module's code
3.
in a standard module's code
4.
in a standard module's Properties
Q 23 / 36
1.
The interface itself is part of the class module.
2.
by means of the Interface keyword and the name of the interface
3.
by means of the Implements keyword and the name of the interface
4.
The name of the interface is passed as a parameter.
Q 24 / 36
1.
Set Option Global at the top of Module1
2.
Declare module-level variables as Private
3.
Set Module Level Scope at the top of Module1
4.
Set Option Private Module at the top of Module1
Q 25 / 36
1.
For i = 0 To UBound(MyArray,1)
2.
For i = 1 To UBound(MyArray,1)
3.
For i = LBound(MyArray,1) To UBound(MyArray,1)
4.
It depends on whether Option Base 0 or Option Base 1 is in use.
Q 26 / 36
Enum TestEnum Test1 Test2 Test3 End Enum
1.
0
2.
1
3.
3
4.
2
Q 27 / 36
1.
Dim MyArray() As Integer
2.
Dim MyArray() As Array
3.
Dim MyArray As Integer
4.
Dim MyArray As Array
Q 28 / 36
1.
Set Macro Security to Trust Access to the VBA Project Object Model
2.
The project's workbook should be protected in the Ribbon's Review tab
3.
Include a reference to Microsoft VBA Extensibility 5.3
4.
Include a reference to Microsoft VBA Extensibility 5.3 and set Macro Security to Trust Access to the VBA Project Object Model
Q 29 / 36
1. Select the project in the Project window of the Visual Basic Editor 2. Click the Design Mode button and select Insert Mode 1. Select the project in the Project window of the Visual Basic Editor 2. Click the Toolbox button and select UserForm 1. Select the project in the Project window of the Visual Basic Editor 2. Right-click the Run menu and select Customize 1. Select the project in the Project window of the Visual Basic Editor 2. Click Insert > UserForm
1.
undefined
2.
undefined
3.
undefined
4.
undefined
Q 30 / 36
Dim MyVar As String Sub AAA() Dim MyVar As String MyVar = "Procedure AAA Scope" End Sub Sub BBB() MyVar = "Procedure BBB Scope" End Sub
1.
MyVar equals "Procedure AAA Scope"
2.
ISNULL(MyVar) is TRUE
3.
MyVar equals "Procedure BBB Scope"
4.
MyVar is NULL
Q 31 / 36
Public Property Get HDL() As Double HDL = pHDL End Property Public Property Let HDL(Value As Double) pHDL = Value End Property Property Get HDL() As Double HDL = Value End Property Property Let HDL(Value As Double) pHDL = Value End Property Public Property Get HDL() As Double HDL = Value End Property Public Property Let HDL(Value As Double) pHDL = Value End Property Public Property Get HDL() As Single HDL = pHDL End Property Public Property Let HDL(Value As Double) pHDL = Value End Property
1.
Public Property Get HDL() As Double
HDL = pHDL
End Property
Public Property Let HDL(Value As Double)
pHDL = Value
End Property
2.
Property Get HDL() As Double
HDL = Value
End Property
Property Let HDL(Value As Double)
pHDL = Value
End Property
3.
Public Property Get HDL() As Double
HDL = Value
End Property
Public Property Let HDL(Value As Double)
pHDL = Value
End Property
4.
Public Property Get HDL() As Single
HDL = pHDL
End Property
Public Property Let HDL(Value As Double)
pHDL = Value
End Property
Q 32 / 36
1.
The scope of constants is limited to the procedure that declares them
2.
Constants are declared at compile time, but variables are declared at run time
3.
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.
4.
The Const declaraton specifies the most efficient type given the constant's value
Q 33 / 36
1.
two (one for the properties and one for the methods)
2.
one (each class is declared in the same module)
3.
four (one for each class)
4.
as many as are required by the variable types that the objects return
Q 34 / 36
Sub MakeErrors() Dim Y As Variant, Z As Variant On Error Resume Next Y = 1 / 0 MsgBox "Y = " & Y On Error GoTo 0 Z - (0 - 3) ^ 0.5 MsgBox "Z = " & Z End Sub
1.
an error message
2.
Y and Z
3.
Z = in a message box and then a subsequent errpr message
4.
Y = in a message box and then a subsequent errpr message
Q 35 / 36
Private Sub CommandButton1_Click() If FoundErrors(Me) Then _ Me.Show End Sub Private Sub CommandButton1_Click() If Not FoundErrors(UserForm1) Then _ Unload UserForm1 End Sub Private Sub CommandButton1_Click() Me.Hide Do While FoundErrors(Me) Me.Show Loop End Sub Private Sub CommandButton1_Click() Do While FoundErrors(UserForm1) UserForm1.show Loop End Sub
1.
Private Sub CommandButton1_Click()
If FoundErrors(Me) Then _
Me.Show
End Sub
2.
Private Sub CommandButton1_Click()
If Not FoundErrors(UserForm1) Then _
Unload UserForm1
End Sub
Q 36 / 36