Skip to Main Content
Excel® 2007 VBA Programmer's Reference
book

Excel® 2007 VBA Programmer's Reference

by John Green, Stephen Bullen, Rob Bovey, Michael Alexander
March 2007
Intermediate to advanced content levelIntermediate to advanced
1173 pages
26h 1m
English
Wrox
Content preview from Excel® 2007 VBA Programmer's Reference

Chapter 5. Using Names

One of the most useful features in Excel is the ability to create names. You can create a name by selecting the Formulas tab on the Ribbon and clicking the Name Manager button to display the Name Manager dialog box, shown in Figure 5-1. If the name refers to a range, you can create it by selecting the range, typing the name into the Name box at the left side of the Formula bar, and pressing Enter. However, in Excel, names can refer to more than just ranges.

Figure 5-1

Figure 5-1. Figure 5-1

A name can contain a number, text, or a formula. Such a name has no visible location on the worksheet and can only be viewed in the Name Manager dialog box. Therefore, you can use names to store information in a workbook without having to place the data in a worksheet cell. Names can be declared hidden so they don't appear in the Name Manager dialog box. This can be a useful way to keep the stored information from being seen by users.

The normal use of names is to keep track of worksheet ranges. This is particularly useful for tables of data that vary in size. If you know that a certain name is used to define the range containing the data you want to work on, your VBA code can be much simpler than it might otherwise be. It is also relatively simple, given a few basic techniques, to change the definition of a name to allow for changes that you make to the tables in your code.

The Excel object ...

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® 2007 Power Programming with VBA

Excel® 2007 Power Programming with VBA

John Walkenbach
Microsoft® Office Excel 2003 Programming Inside Out

Microsoft® Office Excel 2003 Programming Inside Out

Curtis Frye, Wayne S. Freeze, Felicia K. Buckingham

Publisher Resources

ISBN: 9780470046432Purchase book