Microsoft Excel 2010 looks similar to Microsoft Excel 2007 but both are considerably different from Microsoft Excel 2003. MS Excel 2010 employs interactive ribbon controls for the menu bar instead of the old menu structure. Fortunately, the Visual Basic Editor (VBE) remains largely the same as that of version 2003. However, finding the active-x controls on the ribbon control is not as obvious as in Microsoft Excel 2003. You need to locate the Developer tab and click on it to launch the Excel VBA 2010 project window, as shown in Figure 1.1.
Sometime the Developer tab is not shown on the menu bar. What should you do then? You have to open the Excel Options dialog by clicking File and then select options. The Excel Options dialog is as shown in Figure 1.2:
In the Excel Options window, select customize ribbons and you can see the following dialog box, make sure you check the Developer option, as shown in Figure 1.3:
Figure 1.3: Excel Options
After clicking on the Developer tab, you will be presented with the Developer window when you can have access to the VBA 2010 editor as well as recording macros and more, as shown below:
Figure 1.4: The developer window
Clicking on View Code will launch the Excel VBA Editor Code Window.
Figure 1.5: The Excel VBA 2010 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 2010”
As shown in Figure 1.6
Whenever the user clicks on worksheet 1, the following message box will pop out: