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 event fires when a cell's value is changed by the user on a worksheet?
Answer: Worksheet_Change
The Worksheet_Change event fires whenever a user or external link changes a cell in the worksheet.
What does Application.ScreenUpdating = False do in a VBA macro?
Answer: Prevents the screen from refreshing while the macro runs
Setting ScreenUpdating to False stops the screen from flickering during macro execution, improving speed.
Which function returns the number of characters in a string in VBA?
Answer: Len
Len(string) returns the number of characters contained in the string argument.
In VBA, what does the keyword 'Me' refer to inside a UserForm's code module?
Answer: The UserForm itself
Me refers to the instance of the class (UserForm, worksheet, or workbook) in whose code module it appears.
What VBA construct handles errors that occur during runtime?
Answer: On Error GoTo
VBA uses On Error GoTo [label] to redirect execution to an error-handling block when a runtime error occurs.
Which property of a Range object returns the number of rows in that range?
Answer: Rows.Count
Range.Rows.Count returns an integer representing how many rows are in the specified range.
What is the VBA equivalent of Excel's VLOOKUP function when searching a sorted array?
Answer: Application.WorksheetFunction.VLookup
Application.WorksheetFunction.VLookup lets you call Excel's built-in VLOOKUP from within VBA code.