PROGRAMMING WITH VBA - Practice Mode

1) Which scope does the variable declared with dim and remains in the existence only as long as the procedure in which if is declared is running?
Correct Answer: Local scope
2) What will be the output of the following VBA code?
Sub test()
a = 9
Debug.Print Sqr(a)
End sub
Correct Answer: 3
3) What will be the output for the following VBA code?Debug.print
DateDiff('yyyy','1/12/2016','31/1/2017')
Correct Answer: 1
4) What will be the output of the following VBA code?
Sub test()
x = 'institue'
Debug.print Format(x,'>')
End sub
Correct Answer: Institute
5) What will be the output of the following VBA code?
Sub test()
Dim S AS string
S = 'wholehearted'
Debug.Print mid(s,6,4)
End sub
Correct Answer: hear