Visual Basic Tools in Excel 2007
Visual Basic Tools in Excel 2007:-
Visual Basic is a powerful development environment. Although this chapter cannot offer a complete course on VBA, if you are new to VBA, you should take advantage of the following:
1. As you begin to type code, Excel usually offers a drop-down with valid choices. This feature, known as AutoComplete, allows you to type code faster and eliminate typing mistakes.
2. For assistance with any keyword, you can put the cursor in the keyword and press F1. You might need your installation CDs because the VBA Help file can be excluded from the installation of Office 2007.
3. Excel checks each line of code as you finish it. Lines in error appear in red. Comments appear in green. You can add a comment by typing a single apostrophe. You should use lots of comments so you can remember what each section of code is doing.
4. Despite the aforementioned error checking, Excel may still encounter errors at runtime. If this happens, you can click the Debug button. The line that caused the error is highlighted in yellow. You can then however your mouse cursor over any variable to see the current value of the variable.
5. When you are in Debug mode, you can use the Debug menu to step through code line-by-line. You can toggle back and forth between Excel and VBA to see the effect of running a line of code on the worksheet.
6. Other great debugging tools are breakpoints, the Watch window, the Object Browser, and the Immediate window. You can read about these tools in the Excel VBA Help menu.
|