0
0
Excelspreadsheet~20 mins

Running 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!
🎯 Scenario
intermediate
2:00remaining
Running a Macro from a Button

You want to run a macro named FormatReport by clicking a button on your Excel sheet. Which step correctly assigns the macro to the button?

AInsert a shape, then type '=FormatReport()' in the formula bar.
BDouble-click the button to open the macro editor and type 'FormatReport'.
CClick the button and press Ctrl+R to run the macro automatically.
DRight-click the button, choose 'Assign Macro', then select 'FormatReport' and click OK.
Attempts:
2 left
💡 Hint

Think about how Excel links buttons to macros without typing formulas.

📊 Formula Result
intermediate
2:00remaining
Macro to Clear Cells

You run this macro to clear cells A1 to A3. What will be the value in cell A2 after running?

Excel
Sub ClearCells()
  Range("A1:A3").ClearContents
End Sub
A"" (empty cell)
B0
CError #REF!
DThe original value remains unchanged
Attempts:
2 left
💡 Hint

ClearContents removes the content but not the cell itself.

Function Choice
advanced
2:00remaining
Choosing the Right VBA Method to Run a Macro

You want to run a macro named UpdateSummary from another macro. Which VBA statement correctly runs it?

ACall UpdateSummary
BExecuteMacro UpdateSummary
CRunMacro("UpdateSummary")
DStartMacro("UpdateSummary")
Attempts:
2 left
💡 Hint

Think about the VBA keyword used to call another macro or procedure.

data_analysis
advanced
2:00remaining
Macro Execution Effect on Workbook Data

A macro runs and deletes all rows where column B is empty. After running, how many rows remain if the original data had 10 rows and 3 had empty cells in column B?

Excel
Sub DeleteEmptyRows()
  Dim i As Integer
  For i = 10 To 1 Step -1
    If Cells(i, 2).Value = "" Then Rows(i).Delete
  Next i
End Sub
A0 rows remain
B7 rows remain
C10 rows remain
D3 rows remain
Attempts:
2 left
💡 Hint

Rows with empty column B cells are deleted one by one from bottom to top.

🧠 Conceptual
expert
2:00remaining
Understanding Macro Security Settings

Which macro security setting in Excel allows macros to run only if they are digitally signed by a trusted publisher?

AEnable all macros (not recommended)
BDisable all macros with notification
CDisable all macros except digitally signed macros
DDisable all macros without notification
Attempts:
2 left
💡 Hint

Think about the setting that trusts only signed macros.