The following Excel image has a VBA program (see below).
What will be the result after the program is executed?
Any cells not displayed are currently empty, and any cells with numbers are formatted numeric.
Sub AFD ()
i =7
k=1
If Cells(i, k + 1).Value = "PAOLUCCI" Then Cells(i + 1, k).Font.Color = vbRed Else _
Cells(i + 1, k + 1).Font.Color = vbGreen
End Sub
Answer:
A. Employee ID WCHA is in red font
B. Employee ID WCHA is in green font
C. Last name Chan is in red font
D. Last name Chan is in green font
E. None of the above are correct
,Question 11
The following Excel image has a VBA program (see below).
What will be the result after the program is executed?
Any cells not displayed are currently empty, and any cells with numbers are formatted numeric.
Sub AFD ()
a=0
lastrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 7 To lastrow step 2
a = a + Cells(i, 5).Value
Next
Cells(lastrow + 2, 1).Value = "The SUM of AFD is"
Cells(lastrow + 2, 5).Value = a
End Sub
,Answer
A. 0
B. 15
C. 28
D. 83
E. The program is incorrect – will not run
, Question 16
The following Excel image has a VBA program (see below).
What will be the result after the program is executed?
Any cells not displayed are currently empty, and any cells with numbers are formatted numeric.
Sub AFD()
a=0
i =7
Do While i < 12
a = a + Cells(i, 5).Value
i=i+1
Loop
MsgBox a
End Sub