Skip to Content
Excel VBA Programming For Dummies, 6th Edition
book

Excel VBA Programming For Dummies, 6th Edition

by Dick Kusleika
February 2022
Beginner to intermediate content levelBeginner to intermediate
432 pages
9h 21m
English
For Dummies
Content preview from Excel VBA Programming For Dummies, 6th Edition

Chapter 14

VBA Programming Examples

IN THIS CHAPTER

Bullet Working with ranges in your VBA code

Bullet Changing Boolean and non-Boolean settings

Bullet Manipulating charts with VBA

Bullet Making your VBA code run as fast as possible

A good example often communicates a concept much better than a lengthy description of the underlying theory. In that spirit, this chapter presents several examples to demonstrate common VBA techniques.

These examples are organized into the following categories:

  • Working with ranges
  • Changing Excel settings
  • Working with charts
  • Speeding up your VBA code

Although you might be able to use some of the examples directly, in most cases you must adapt them to your own needs.

Working with Ranges

Most of your VBA programming probably involves worksheet ranges. (For some background on Range objects, refer to Chapter 8.) When working with Range objects, keep the following points in mind:

  • Your VBA doesn’t need to select a range to work with it.
  • If your code does select a range, its worksheet must be active.
  • The macro recorder doesn’t always generate the best code. Often, you can create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel VBA Programming For Dummies, 5th Edition

Excel VBA Programming For Dummies, 5th Edition

Michael Alexander, John Walkenbach

Publisher Resources

ISBN: 9781119843078Purchase Link