โ† All MCAS Flashcard Decks

Macros & Automation Flashcards

7 cards from real MCAS practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 Macros & Automation flashcards as text
  1. Which object in VBA refers to the currently active workbook in Excel?

    Answer: ActiveWorkbook

    ActiveWorkbook refers to the workbook that currently has focus, while ThisWorkbook refers to the workbook containing the code.

  2. What VBA statement is used to display a message box to the user?

    Answer: MsgBox

    MsgBox is the VBA function used to display a pop-up message box to the user.

  3. In a VBA macro, which loop structure repeats a block of code a specific number of times?

    Answer: For...Next

    The For...Next loop iterates a set number of times using a counter variable.

  4. How can a macro be assigned to a button in an Excel worksheet?

    Answer: Right-click the button and select 'Assign Macro'

    Right-clicking a form control button and selecting 'Assign Macro' links a recorded or written macro to that button.

  5. Which Excel Quick Access Toolbar customization allows you to run a macro with one click?

    Answer: Adding a macro command to the QAT via File > Options > Quick Access Toolbar

    You can add a macro as a custom button on the Quick Access Toolbar through File > Options > Quick Access Toolbar.

  6. What is the purpose of the 'Option Explicit' statement at the top of a VBA module?

    Answer: It requires all variables to be declared before use

    Option Explicit forces the developer to declare all variables, reducing errors from typos in variable names.

  7. In VBA, which keyword is used to declare a variable?

    Answer: Dim

    The 'Dim' keyword (short for Dimension) is used in VBA to declare a variable and its data type.