Excecl VBA Classic Excel VBA 2010 Excel VBA 365 Excel VBA Examples About Us

Lesson 1 Introduction


Microsoft Excel 365 resembles older versions of Microsoft Excel but added some new features. Surprisingly, the Visual Basic Editor (VBE) remains largely the same as that of older versions.

When you start Microsoft Excel 365, The first workbook is launched,as shown in the figure below:

Figure 1.1

The Developer tab is where you should look for to access a host of tools for developing Excel VBA 365. After clicking on the Developer tab, the Developer IDE will appear, as shown below:

Figure 1.2 The developer IDE

In the Developer IDE, you can choose to use any of the tools available. You may want to record macro, access the Visual Basic Editor, insert some Active-X controls and more.

Clicking on View Code or Visual Basic will launch the Excel VBA 365 Editor Window(known as Microsoft Visual Basic for Applications). This is environment that allows you to write VBA code.

Figure 1.3 The Excel VBA 365 Editor

Now select Sheet1 in the VBA objects explorer window on the far left and the Book1-Sheet1 windows appears. Enter the following statements in the sheet 1 code window:

 Private Sub Worksheet_Activate()
 MsgBox "Welcome to Excel VBA 365"
End Sub
 

As shown in Figure 1.4

Figure 1.4

Whenever the user clicks on worksheet 1(You must add a second worksheet then click on worksheet1 to see the effect), the following message box will pop out:

Figure 1.5

For Excel 365, If you wish to save the file with VBA or macro, you must save it with the macro-enabled file with the xlsm extension, otherwise you can't run your VBA or macro. Excel 365 will prompt what type of file to save, as shown below:

Figure 1.6


Copyright ® 2020 Dr.Liew Voon Kiong . All rights reserved   [Privacy Policy]

Contact: Facebook Page