Challenge - 5 Problems
Macro Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate2: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 SubAttempts:
2 left
💡 Hint
Remember the formula in B1 multiplies the value in A1 by 2.
✗ Incorrect
The macro sets A1 to 10, then puts the formula =A1*2 in B1. Since A1 is 10, B1 shows 20.
❓ Function Choice
intermediate1: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?
Attempts:
2 left
💡 Hint
Look for the standard way to end a VBA subroutine.
✗ Incorrect
In VBA, macros are subroutines that end with 'End Sub'. There is no 'Stop Recording' or 'End Macro' command in VBA code.
🎯 Scenario
advanced2: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"Attempts:
2 left
💡 Hint
To get a cell's content, you need to use .Value property of a Range object.
✗ Incorrect
Option A correctly assigns the value of cell B1 to the active cell. Other options either treat B1 as a string or use incorrect syntax.
❓ data_analysis
advanced2: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 SubAttempts:
2 left
💡 Hint
Protected sheets prevent changes to locked cells.
✗ Incorrect
Trying to change a cell on a protected sheet without unprotecting it causes a run-time error 1004.
🧠 Conceptual
expert3: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
Attempts:
2 left
💡 Hint
The loop runs from 1 to 3 inclusive.
✗ Incorrect
The loop runs 3 times, once for each value 1, 2, and 3, matching the recorded macro's actions.