← All Excel VBA Flashcard Decks

Excel VBA Flashcards

7 cards from real Excel VBA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Excel VBA flashcards as text
  1. Which VBA collection object contains all open workbooks in the current Excel instance?

    Answer: Workbooks

    The Workbooks collection is a property of the Application object and holds all currently open Workbook objects.

  2. What does the MsgBox function return when the user clicks the Cancel button?

    Answer: vbCancel (2)

    MsgBox returns the VBA constant vbCancel, which has an integer value of 2, when Cancel is clicked.

  3. Which statement is used to define a reusable block of code that does NOT return a value in VBA?

    Answer: Sub

    A Sub procedure performs actions but does not return a value, unlike a Function which returns a result.

  4. How do you copy a range in VBA without including the clipboard (direct value copy)?

    Answer: destRange.Value = sourceRange.Value

    Assigning .Value directly between ranges transfers data without using the clipboard or triggering a copy animation.

  5. What does the Cells property return when called as Cells(2, 3) on a worksheet?

    Answer: The cell in row 2, column 3 (C2)

    Cells(row, column) uses numeric row and column indices, so Cells(2,3) refers to row 2, column C — cell C2.

  6. Which VBA function extracts a substring from the right side of a string?

    Answer: Right

    Right(string, length) returns the specified number of characters from the rightmost end of the string.

  7. What happens when you use 'ReDim Preserve' on a dynamic array in VBA?

    Answer: The array is resized while keeping existing data

    ReDim Preserve resizes a dynamic array and retains the values already stored in it, unlike plain ReDim which resets them.