VISUAL BASIC for APPLICATIONS TEST

Progress

1.

Why Macro is used

2.

VBA Code run by

3.

The _______________ statement first executes the statements and then tests the condition after each execution

4.

To force all variables is a VBA project to be declared, which must be stated in a module?

5.

Which of the following statements is not true about user-defined functions?

6.

Do…Loop... Until code block is always executed once.

7.

What will be the output of the following code?

Sub LoopExample()

Dim StartNumber As Integer

Dim EndNumber As Integer

Dim Answer As Integer

Answer = 5

EndNumber = 5

For StartNumber = 1 To EndNumber

Answer = Answer + EndNumber

Next StartNumber

MsgBox Answer

      End Sub

8.

An array that maintains multiple sets of information referenced by more than one index is called ________________

9.

To close a form named Form1, you can use:

10.

__________ are the attributes of an object that control the object's appearance and behavior.

11.

A Combo box is loaded in the From_Initialize event with:

Combo1.AddItem “Red”

Combo1.AddItem “Blue”

Combo1.AddItem “Green”

12.

Which of the following is default in VBA for data passing?

13.

What data type can hold any type of data?

14.

Given the following section of code, if a programmer called the GetAge() subroutine, what value would the message box display? 

Private Sub GetAge()

Dim UserAge As String

UserAge = 10

UserAge = InputBox("Enter your age", "Get Age")

Call ShowAge

End Sub

Private Sub ShowAge()

Dim UserAge As Integer

UserAge = 0

MsgBox (UserAge)

End Sub

15.

Which is the conversion for the following If...Then...ElseIf statement to a Select...Case statement?

If intValue > 0 And intValue <= 9 Then

discount = .10

Else If intValue >9 And intValue <=20

discount = .15

Else

discount = .20

16.

A loop that does not have the way of stopping is called a ___________

17.

This control is used for titles/captions

18.

What do you need to select to set the developer mode?

19.

Which part of VBA window, refers to area where code is written.

20.

Study the screenshot below. What is the appropriate action to take when a workbook displays this message (Security Warning Macros have been disabled)?

21.

There can be different data types of an element in an array

22.

A ______________ returns a value to the part of the program that called it.

23.

When the block of code finishes the execution, what will the final value of X be?

Public Sub Example ()

Dim Y As Integer

Dim X As Integer

X = 0

Y = 10

For Count = Y To 1 Step -2

X = X + Y

If Y = (Y = 1) Then

Exit For

End If

Next Count

X = X / X

MsgBox X

End Sub

24.

Which character in VBA, indicates start of a comment

25.

Which of the following arithmetic operations has the highest level of precedence?

26.

What will be the output of the following statement?

txtBox.Text = FormatCurrency(1234.567)

27.

Given that x = 7, y = 2, and z = 4, the following If block will display “TRUE”. If (x > y) Or (y > z) Then txtBox.Text = “TRUE” End If

28.

An object is composed of :

29.

Basic Excel Object model as follows:

30.

Private Procedure can be called from anywhere in the project

Assessment complete! Thank you for you time.
We are redirecting you to the result page, Please click on 'SUBMIT'