Download Using VBA to Create Pivot Tables

Transcript
12_0789736012_CH11.qxd
12/11/06
6:26 PM
Page 233
Introducing VBA
Project Explorer
233
Code window
Figure 11.2
The Visual Basic Editor
window is lurking
behind every copy of
Excel shipped since 1993.
Properties window
Properties window—The Properties window is important when you begin to
program user forms. It has some use when you’re writing normal code, so enable it by
pressing F4.
Code window—This is the area where you write your code. Code is stored in one or
more code modules attached to your workbook. To add a code module to a workbook,
select Insert, Code Module from the application menu.
Visual Basic Tools
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 these important tools:
As you begin to type code, Excel may offer a drop-down with valid choices. This feature, known as AutoComplete, allows you to type code faster and eliminate typing mistakes.
For assistance on any keyword, 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.
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. Use lots of
comments so you can remember what each section of code is doing.
11