

Like the mail boxes, each variable must be given a name. In VBA, variables are areas allocated by the computer memory to hold data.

The contents of the variables changes every now and then, just like the mail boxes. Variables are like mail boxes in the post office. The first statement will fill up cell A1 to cell A10 with the phrase "Visual Basic" while the second statement add the value in cell A11 and cell B11 and then show the sum in cell C11. Then you enter the statement as shown in the figure. Next, you click on the command button and the Visual Basic Editor will appear. Then you click on the command buttton and draw it on the spreadsheet. In order to place a command button on the spreadsheet, you need to click View on the MS Excel menu bar and then click on toolbar and finally select the Control Toolbox after which the control toolbox bar will appear. Let’s start with the command button first. There are two ways which you could program a VBA, one is to place a command button on the spreadsheet and start programming by clicking the command button, another one is to write Visual Basic functions inside the VB Editor. By using VBA, you can build some very powerful tools in MS Excel, including financial and scientific applications such as getting financial data from the Internet as well as linear programming. The reason VBA is needed is due to the limitations in using the built-in functions of VB and macro recording. You can program VBA in every version of Microsoft Office, including MS Office 97, MS Office2000, MS Office2002, MS Office2003 and MS Office XP. The applications you build with MS Excel is called Visual Basic for Applications, or simply VBA. Why? Because there is built-in Visual Basic Editor in Microsoft Excel, and you can use it to customize and extend capabilities of MS Excel. A lot of people might not realize that they can actually learn the fundamentals of Visual Basic programming without having a copy of Visual Basic professional.
