0
0
Excelspreadsheet~5 mins

Simple VBA procedures in Excel - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a VBA procedure in Excel?
A VBA procedure is a set of instructions written in Visual Basic for Applications that performs a specific task in Excel, like automating actions or calculations.
Click to reveal answer
beginner
How do you start writing a simple VBA procedure?
Open the VBA editor by pressing Alt + F11, insert a new module, and write a Sub procedure starting with Sub ProcedureName() and ending with End Sub.
Click to reveal answer
beginner
What does the following VBA code do?<br>
Sub HelloWorld()
 MsgBox "Hello, world!"
End Sub
This procedure shows a message box with the text "Hello, world!" when run.
Click to reveal answer
beginner
How do you run a VBA procedure in Excel?
You can run a VBA procedure by pressing F5 in the VBA editor or by assigning the procedure to a button or shortcut in Excel.
Click to reveal answer
intermediate
What is the difference between a Sub and a Function in VBA?
A Sub performs actions but does not return a value. A Function performs actions and returns a value that can be used in Excel formulas.
Click to reveal answer
Which keyword starts a VBA procedure that does not return a value?
ASub
BFunction
CDim
DSet
What does the MsgBox function do in VBA?
ASaves the workbook
BDisplays a message box to the user
COpens a new worksheet
DCalculates a sum
How do you open the VBA editor in Excel?
APress F1
BPress Ctrl + C
CClick File > Save As
DPress Alt + F11
Which statement correctly ends a VBA Sub procedure?
AEnd Sub
BStop
CExit Sub
DEnd Function
What is the main purpose of a VBA procedure?
ATo format cells manually
BTo enter data into cells
CTo automate tasks in Excel
DTo create charts
Explain how to create and run a simple VBA procedure that shows a message box.
Think about the steps from opening the editor to seeing the message.
You got /4 concepts.
    Describe the difference between a Sub and a Function in VBA.
    Focus on what each procedure type can give back after running.
    You got /4 concepts.