0
0
Excelspreadsheet~10 mins

Running macros in Excel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to run a macro named "MyMacro" using VBA.

Excel
Sub RunMacro()
    [1] MyMacro
End Sub
Drag options to blanks, or click blank then click option'
AStart
BCall
CRun
DExecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using Application.Run without the correct syntax
Using keywords like Execute or Start which are not valid in VBA for macros
2fill in blank
medium

Complete the code to run a macro named "FormatSheet" using Application.Run.

Excel
Sub RunFormatMacro()
    Application.[1] "FormatSheet"
End Sub
Drag options to blanks, or click blank then click option'
ARun
BExecute
CCall
DStart
Attempts:
3 left
💡 Hint
Common Mistakes
Using Call instead of Run with Application object
Trying to run macro without quotes around the name
3fill in blank
hard

Fix the error in the code to run a macro named "DataClean".

Excel
Sub RunDataClean()
    Application.Run[1] "DataClean"
End Sub
Drag options to blanks, or click blank then click option'
A"
B)
C,
D(
Attempts:
3 left
💡 Hint
Common Mistakes
Missing parentheses causes syntax errors
Using commas or quotes incorrectly around the macro name
4fill in blank
hard

Fill both blanks to run a macro named "UpdateReport" with one argument "2024".

Excel
Sub RunUpdateReport()
    Application.[1] ("UpdateReport", [2])
End Sub
Drag options to blanks, or click blank then click option'
ARun
B"2024"
C2024
DCall
Attempts:
3 left
💡 Hint
Common Mistakes
Passing argument without quotes causes errors
Using Call instead of Application.Run for arguments
5fill in blank
hard

Fill all three blanks to run a macro named "ProcessData" with two arguments: a worksheet and a number.

Excel
Sub RunProcessData()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1")
    Application.[1] ("ProcessData", [2], [3])
End Sub
Drag options to blanks, or click blank then click option'
ARun
Bws
C10
D"ProcessData"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the macro name without quotes
Passing arguments as strings when they should be objects or numbers