Introduction to Excel VBA 365
In this lesson, you will learn what Excel VBA is, why it is useful, and how to create your first macro in Microsoft Excel 365.
What is Excel VBA?
Excel VBA, or Visual Basic for Applications, is the built-in programming language inside Microsoft Excel. It lets you automate repetitive tasks, create custom solutions, and extend what Excel can do.
With VBA, you can record or write macros, create your own functions, build forms, and interact with workbooks, worksheets, and ranges in a much more powerful way than by using formulas alone.
Why learn VBA in Excel 365?
VBA remains one of the most practical ways to turn Excel into a productivity tool. In business, education, finance, engineering, and administration, VBA helps users save time and reduce manual work.
- Automate repetitive tasks: Generate reports, format sheets, and process data faster.
- Build custom tools: Create calculators, dashboards, forms, and workflow helpers.
- Improve job skills: VBA is still valuable in many spreadsheet-heavy roles.
- Work smarter: Combine Excel features with code to make solutions more powerful.
- Understand Excel better: VBA teaches you how Excel objects and actions really work.
Write your first macro
Follow these steps to open the VBA editor and create a simple macro.
Step 1: Show the Developer tab
- Go to File > Options.
- Select Customize Ribbon.
- Check Developer, then click OK.
Step 2: Open the Visual Basic Editor
Click the Developer tab and then choose Visual Basic. This opens the VBA editor where you write and manage macro code.
Step 3: Insert a module
- In the Project pane, right-click your workbook project.
- Choose Insert > Module.
Step 4: Type your first macro
Enter the following code in the module window:
Sub HelloWorld()
MsgBox "Welcome to Excel VBA 365"
End Sub
This macro shows a message box. It is a simple but useful starting point for understanding how VBA procedures work.
Step 5: Run the macro
- Return to Excel.
- Open the Developer tab and click Macros.
- Select HelloWorld and click Run.
Lesson summary
- Excel VBA is the programming language built into Microsoft Excel.
- It helps automate repetitive tasks and create custom spreadsheet solutions.
- The Developer tab gives you access to the VBA editor and macros.
- Your first macro can be as simple as showing a message box.