Microsoft Excel 365 looks like 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:
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:
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.
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
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:
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: