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
Which VBA statement exits a For...Next loop immediately?
Answer: Exit For
Exit For immediately transfers control to the statement following the Next keyword.
What does the UBound function return when called on an array?
Answer: The highest valid index
UBound returns the largest available subscript (upper bound) for the specified dimension of an array.
Which method is used to add a new worksheet to a workbook in VBA?
Answer: Worksheets.Add
Worksheets.Add (or Sheets.Add) creates and returns a new worksheet in the workbook.
What is the result of the VBA expression: 10 Mod 3?
Answer: 1
The Mod operator returns the remainder after division; 10 divided by 3 leaves a remainder of 1.
Which VBA function converts a string to all uppercase letters?
Answer: UCase
UCase(string) returns the string with all alphabetic characters converted to uppercase.
How do you declare a variable that can hold any data type in VBA?
Answer: Dim x As Variant
The Variant data type can store any kind of data including numbers, strings, dates, and objects.
What does the VBA keyword 'Nothing' represent?
Answer: An uninitialized or released object reference
Nothing is used with object variables to indicate the variable holds no valid object reference.