Excel VBA (Visual Basic for Applications) is a powerful programming language built into Microsoft Excel that allows users to automate repetitive tasks, customize Excel functionalities, and build advanced solutions like user forms and dashboards.
With VBA, you can:
Think of VBA as Excel’s built-in coding engine that empowers users to take control of spreadsheets and streamline complex workflows.
Learning VBA in Excel 365 gives you a major productivity boost, especially in today’s data-driven workplaces.
Here are 5 great reasons to learn VBA in Excel 365:
In short: Learning VBA makes you a power user—enabling you to do more with Excel in less time.
Let’s walk through how to create your very first Excel VBA macro using the built-in Visual Basic for Applications (VBA) editor in Excel 365.
Before writing any macro, make sure the Developer tab is visible in the Ribbon:
Refer to Figure 1.1 showing the Developer tab added to the Ribbon.
Click on the Developer tab, then select Visual Basic. This opens the VBA Editor, where you can write and manage your macro code.
In the VBA Editor:
This opens a new code window, ready for your macro, as shown in Figure 1.3.
In the module window, type the following code:
Private Sub Worksheet_Activate() MsgBox "Welcome to Excel VBA 365" End Sub
This simple macro displays a message box that says "Welcome to Excel VBA 365", as shown in Figure 1.4
HelloWorld
from the list and click Run.A pop-up message will appear — Congratulations, you’ve just run your first VBA macro!
Always save your workbook as a Macro-Enabled Workbook (.xlsm) to preserve your macros.
Copyright ® 2020 Dr.Liew Voon Kiong . All rights reserved [Privacy Policy]
Contact: Facebook Page