Excel 2010 Bible

(National Geographic (Little) Kids) #1

Part VI: Programming Excel with VBA


796


Displaying the Developer Tab


If you plan to work with VBA macros, you’ll want to make sure that the Developer tab is present
on the Excel Ribbon. The Developer tab, which does not appear by default, contains useful com-
mands for VBA users. To display this tab


  1. Choose File ➪ Options.

  2. In the Excel Options dialog box, select Customize Ribbon.

  3. In the list box on the right, place a check mark next to Developer.

  4. Click OK to return to Excel.


Figure 39.1 shows the Ribbon commands of the Developer tab.

VBA is an extremely rich programming language with thousands of uses. The following list contains just
a few things that you can do with VBA macros. (Not all of these tasks are covered in this book.)

l (^) Insert boilerplate text. If you need to enter standard text into a range of cells, you can create
a macro to do the typing for you.
l (^) Automate a procedure that you perform frequently. For example, you may need to prepare a
month-end summary. If the task is straightforward, you can develop a macro to do it for you.
l (^) Automate repetitive operations. If you need to perform the same action in 12 different work-
books, you can record a macro while you perform the task once — and then let the macro
repeat your action in the other workbooks.
l (^) Create a custom command. For example, you can combine several Excel commands so that
they’re executed from a single keystroke or from a single mouse click.
l (^) Create a simplified “front end” for users who don’t know much about Excel. For example,
you can set up a foolproof data-entry template.
l (^) Develop a new worksheet function. Although Excel includes a wide assortment of built-in
functions, you can create custom functions that greatly simplify your formulas.
l (^) Create complete macro-driven applications. Excel macros can display custom dialog boxes
and respond to new commands added to the Ribbon.
l (^) Create custom add-ins for Excel. Most add-ins shipped with Excel were created with Excel
macros. I used VBA exclusively to create my Power Utility Pak.
What You Can Do with VBA

Free download pdf