0
0
Excelspreadsheet~20 mins

VBA editor basics in Excel - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
VBA Editor Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the VBA Editor Window
Which window in the VBA editor shows the list of all modules, forms, and classes in your workbook?
ACode Window
BProject Explorer
CProperties Window
DImmediate Window
Attempts:
2 left
💡 Hint
This window helps you navigate between different VBA components.
📊 Formula Result
intermediate
1:30remaining
Output of a Simple VBA MsgBox
What message box text appears when you run this VBA code?
Sub ShowMessage()
  MsgBox "Hello, Excel!"
End Sub
Excel
Sub ShowMessage()
  MsgBox "Hello, Excel!"
End Sub
ASyntax error in code
BA message box with text: ShowMessage
CNo message box appears
DA message box with text: Hello, Excel!
Attempts:
2 left
💡 Hint
MsgBox shows a popup with the text inside quotes.
Function Choice
advanced
2:00remaining
Choosing the Correct VBA Function to Get Cell Value
Which VBA code correctly reads the value from cell A1 in the active worksheet?
ARange("A1").Value
BWorksheetFunction.CellValue("A1")
CCells(1, "A").Text
DActiveSheet.Cell("A1")
Attempts:
2 left
💡 Hint
Use Range with cell address and .Value to get the content.
🎯 Scenario
advanced
1:30remaining
Debugging VBA Code with Breakpoints
You want to pause your VBA code at a specific line to check variable values. What is the correct way to set a breakpoint in the VBA editor?
ARight-click the code and select 'Stop Execution'
BInsert a MsgBox before the line
CClick the gray margin next to the code line to toggle a red dot
DAdd the line 'Pause' in your code
Attempts:
2 left
💡 Hint
Breakpoints appear as red dots in the margin.
data_analysis
expert
2:30remaining
Understanding Variable Scope in VBA Modules
Given this VBA code in a module:
Dim counter As Integer

Sub Increment()
  counter = counter + 1
  MsgBox counter
End Sub

Sub Reset()
  counter = 0
End Sub

What will be the message box output after running Increment twice, then Reset, then Increment once?
Excel
Dim counter As Integer

Sub Increment()
  counter = counter + 1
  MsgBox counter
End Sub

Sub Reset()
  counter = 0
End Sub
A1, then 2, then no message, then 1
B1, then 2, then 1, then 2
C1, then 2, then 0, then 1
D1, then 1, then 0, then 1
Attempts:
2 left
💡 Hint
Module-level variables keep their value between sub calls unless reset.