Quick Questions on VBA

  • Hello everyone,

    I have an important exam coming up and desperately need the answers to these questions. Please help. I would be highly grateful for the same.

    Please select the right option -

    Q1. What object is needed to put a userform module in a VBA project?

    1. associated standard code module
    2. UserForm
    3. associated class module
    4. userForm class

    Q2. What is the output of the following?

    1. Sub UseSum()
    2. Dim TestArray() As Integer, Total As Integer
    3. ReDim TestArray(1)
    4. TestArray(1) = 6
    5. ReDim TestArray(2)
    6. TestArray(2) = 3
    7. Total = WorksheetFunction.Sum(TestArray)
    8. End Sub

    1. 3
    2. 0
    3. 9
    4. 6

    Q3. The Driver subroutine is declared by Sub Driver (Y). Which statement results in a compile error?

    1. Driver x
    2. call Driver(x)
    3. call Driver x
    4. Driver (X)

    Q4. You have several variables to display on a user form, and there are too many variables to display at once. Which control best enables the user to see all the variables?

    1. Frame
    2. multipage
    3. TabStrip
    4. ListBox

    Q5. Below is a function named SquareIt. Which version of the subroutine named Area results in a compile error?

    1. Function SquareIt(ByRef Basis As Integer) As Long
    2. SquareIt = Basis ^ 2
    3. End Function

    1. sub Area()

    1. Dim Result As Long, Side As Integer
    2. Side = 5
    3. Result = Squarelt(Side)
    4. End Sub

    2. Sub Area()

    1. Dim Result As Long, Side
    2. Side = 5
    3. Result = SquareIt(Cint(Side))
    4. End Sub

    Q6. 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()?

    1. 10 rows and 10 columns
    2. 10 rows and 1 column
    3. 10 rows and 0 columns
    4. 1 row and 10 columns

    Thank you for your time. Highly appreciate the help :)


    5a. No asking to crack passwords of any kind. Doing so, even innocently, will get you banned.

    5b. No asking for help with homework or college assignments. We will not do it for you. This also applies to the hire Help forum.

    5c. Web scraping. Ozgrid will not assist you in systematically acquiring data (even in the public domain) from a other peoples websites. We will show you how to do excel/browser automation with generic examples and answer specific questions related to browser automation VBA methods

  • royUK

    Closed the thread.