O'Reilly logo

Excel® 2007 Charts by John Walkenbach

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14. VBA Overview and Basic Examples

In This Chapter

  • An overview of using Visual Basic for Applications (VBA) to manipulate charts

  • Macros to activate and deactivate charts

  • Macros to determine whether a chart is selected

  • Macros to count and loop through all charts

  • Macros to delete charts and print charts

This is the first of three chapters that deal with Visual Basic for Applications (VBA). VBA is Excel's programming language, and it is used to automate various aspects of Excel — including charts.

VBA in a Nutshell

VBA is Microsoft's common application scripting language. VBA is included with all Office 2007 applications, and it's also available in applications from other vendors. You use VBA to write procedures, frequently known as macros.

Note

This chapter assumes a basic familiarity with VBA. You should know how to use the VB Editor, enter code, execute procedures, and so on. If you have no experience using VBA, the material in this and the next two chapters will not make much sense. The remainder of this section presents a quick overview of VBA — useful as a refresher for those who haven't used VBA in a while. It's also useful to help novices decide whether learning VBA would be helpful.

Ready for the nutshell version of VBA? Here goes:

  • You perform actions in VBA by executing VBA code.

  • You write (or record) VBA code, which is stored in a VBA module.

  • VBA modules are stored in an Excel workbook, but you view or edit a module using the Visual Basic Editor.

  • A VBA module consists of procedures ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required