0
0
Excelspreadsheet~20 mins

Recording macros in Excel - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Macro Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate
2:00remaining
What is the output of this recorded macro?
You recorded a macro that selects cell A1, types the number 10, then moves to cell B1 and types the formula =A1*2. What value will appear in cell B1 after running the macro?
Excel
Sub Macro1()
    Range("A1").Select
    ActiveCell.Value = 10
    Range("B1").Select
    ActiveCell.Formula = "=A1*2"
End Sub
A20
B0
C10
D#REF!
Attempts:
2 left
💡 Hint
Remember the formula in B1 multiplies the value in A1 by 2.
Function Choice
intermediate
1:30remaining
Which VBA command correctly stops a macro recording?
You want to stop recording your macro in Excel VBA. Which command will correctly end the macro?
AEnd Macro
BStop Recording
CExit Macro
DEnd Sub
Attempts:
2 left
💡 Hint
Look for the standard way to end a VBA subroutine.
🎯 Scenario
advanced
2:30remaining
You recorded a macro but it always types the same text. How to make it type text from a cell instead?
Your recorded macro types the text "Hello" in cell A1 every time. You want to change it so it types whatever text is in cell B1 instead. Which VBA line should replace the fixed text?
Excel
ActiveCell.Value = "Hello"
AActiveCell.Value = Range("B1").Value
BActiveCell.Value = "Range(B1)"
CActiveCell.Value = Cells(B1)
DActiveCell.Value = Range(B1)
Attempts:
2 left
💡 Hint
To get a cell's content, you need to use .Value property of a Range object.
data_analysis
advanced
2:00remaining
What error occurs if you run this macro on a protected sheet?
This macro tries to change cell A1's value on a protected worksheet without unprotecting it first. What error will it cause?
Excel
Sub ChangeCell()
    Range("A1").Value = 100
End Sub
ASyntax error: Missing End Sub
BRun-time error '1004': Application-defined or object-defined error
CNo error, value changes successfully
DCompile error: Invalid procedure call
Attempts:
2 left
💡 Hint
Protected sheets prevent changes to locked cells.
🧠 Conceptual
expert
3:00remaining
How many times will this recorded macro loop run?
You recorded a macro that selects cell A1, types 1, then moves down one cell and types 2, then moves down one cell and types 3. You want to automate this with a loop from 1 to 3. How many times will the loop run to replicate the macro?
Excel
For i = 1 To 3
    ActiveCell.Value = i
    ActiveCell.Offset(1, 0).Select
Next i
A4 times
B2 times
C3 times
D1 time
Attempts:
2 left
💡 Hint
The loop runs from 1 to 3 inclusive.