- •About the Author
- •About the Technical Editor
- •Credits
- •Is This Book for You?
- •Software Versions
- •Conventions This Book Uses
- •What the Icons Mean
- •How This Book Is Organized
- •How to Use This Book
- •What’s on the Companion CD
- •What Is Excel Good For?
- •What’s New in Excel 2010?
- •Moving around a Worksheet
- •Introducing the Ribbon
- •Using Shortcut Menus
- •Customizing Your Quick Access Toolbar
- •Working with Dialog Boxes
- •Using the Task Pane
- •Creating Your First Excel Worksheet
- •Entering Text and Values into Your Worksheets
- •Entering Dates and Times into Your Worksheets
- •Modifying Cell Contents
- •Applying Number Formatting
- •Controlling the Worksheet View
- •Working with Rows and Columns
- •Understanding Cells and Ranges
- •Copying or Moving Ranges
- •Using Names to Work with Ranges
- •Adding Comments to Cells
- •What Is a Table?
- •Creating a Table
- •Changing the Look of a Table
- •Working with Tables
- •Getting to Know the Formatting Tools
- •Changing Text Alignment
- •Using Colors and Shading
- •Adding Borders and Lines
- •Adding a Background Image to a Worksheet
- •Using Named Styles for Easier Formatting
- •Understanding Document Themes
- •Creating a New Workbook
- •Opening an Existing Workbook
- •Saving a Workbook
- •Using AutoRecover
- •Specifying a Password
- •Organizing Your Files
- •Other Workbook Info Options
- •Closing Workbooks
- •Safeguarding Your Work
- •Excel File Compatibility
- •Exploring Excel Templates
- •Understanding Custom Excel Templates
- •Printing with One Click
- •Changing Your Page View
- •Adjusting Common Page Setup Settings
- •Adding a Header or Footer to Your Reports
- •Copying Page Setup Settings across Sheets
- •Preventing Certain Cells from Being Printed
- •Preventing Objects from Being Printed
- •Creating Custom Views of Your Worksheet
- •Understanding Formula Basics
- •Entering Formulas into Your Worksheets
- •Editing Formulas
- •Using Cell References in Formulas
- •Using Formulas in Tables
- •Correcting Common Formula Errors
- •Using Advanced Naming Techniques
- •Tips for Working with Formulas
- •A Few Words about Text
- •Text Functions
- •Advanced Text Formulas
- •Date-Related Worksheet Functions
- •Time-Related Functions
- •Basic Counting Formulas
- •Advanced Counting Formulas
- •Summing Formulas
- •Conditional Sums Using a Single Criterion
- •Conditional Sums Using Multiple Criteria
- •Introducing Lookup Formulas
- •Functions Relevant to Lookups
- •Basic Lookup Formulas
- •Specialized Lookup Formulas
- •The Time Value of Money
- •Loan Calculations
- •Investment Calculations
- •Depreciation Calculations
- •Understanding Array Formulas
- •Understanding the Dimensions of an Array
- •Naming Array Constants
- •Working with Array Formulas
- •Using Multicell Array Formulas
- •Using Single-Cell Array Formulas
- •Working with Multicell Array Formulas
- •What Is a Chart?
- •Understanding How Excel Handles Charts
- •Creating a Chart
- •Working with Charts
- •Understanding Chart Types
- •Learning More
- •Selecting Chart Elements
- •User Interface Choices for Modifying Chart Elements
- •Modifying the Chart Area
- •Modifying the Plot Area
- •Working with Chart Titles
- •Working with a Legend
- •Working with Gridlines
- •Modifying the Axes
- •Working with Data Series
- •Creating Chart Templates
- •Learning Some Chart-Making Tricks
- •About Conditional Formatting
- •Specifying Conditional Formatting
- •Conditional Formats That Use Graphics
- •Creating Formula-Based Rules
- •Working with Conditional Formats
- •Sparkline Types
- •Creating Sparklines
- •Customizing Sparklines
- •Specifying a Date Axis
- •Auto-Updating Sparklines
- •Displaying a Sparkline for a Dynamic Range
- •Using Shapes
- •Using SmartArt
- •Using WordArt
- •Working with Other Graphic Types
- •Using the Equation Editor
- •Customizing the Ribbon
- •About Number Formatting
- •Creating a Custom Number Format
- •Custom Number Format Examples
- •About Data Validation
- •Specifying Validation Criteria
- •Types of Validation Criteria You Can Apply
- •Creating a Drop-Down List
- •Using Formulas for Data Validation Rules
- •Understanding Cell References
- •Data Validation Formula Examples
- •Introducing Worksheet Outlines
- •Creating an Outline
- •Working with Outlines
- •Linking Workbooks
- •Creating External Reference Formulas
- •Working with External Reference Formulas
- •Consolidating Worksheets
- •Understanding the Different Web Formats
- •Opening an HTML File
- •Working with Hyperlinks
- •Using Web Queries
- •Other Internet-Related Features
- •Copying and Pasting
- •Copying from Excel to Word
- •Embedding Objects in a Worksheet
- •Using Excel on a Network
- •Understanding File Reservations
- •Sharing Workbooks
- •Tracking Workbook Changes
- •Types of Protection
- •Protecting a Worksheet
- •Protecting a Workbook
- •VB Project Protection
- •Related Topics
- •Using Excel Auditing Tools
- •Searching and Replacing
- •Spell Checking Your Worksheets
- •Using AutoCorrect
- •Understanding External Database Files
- •Importing Access Tables
- •Retrieving Data with Query: An Example
- •Working with Data Returned by Query
- •Using Query without the Wizard
- •Learning More about Query
- •About Pivot Tables
- •Creating a Pivot Table
- •More Pivot Table Examples
- •Learning More
- •Working with Non-Numeric Data
- •Grouping Pivot Table Items
- •Creating a Frequency Distribution
- •Filtering Pivot Tables with Slicers
- •Referencing Cells within a Pivot Table
- •Creating Pivot Charts
- •Another Pivot Table Example
- •Producing a Report with a Pivot Table
- •A What-If Example
- •Types of What-If Analyses
- •Manual What-If Analysis
- •Creating Data Tables
- •Using Scenario Manager
- •What-If Analysis, in Reverse
- •Single-Cell Goal Seeking
- •Introducing Solver
- •Solver Examples
- •Installing the Analysis ToolPak Add-in
- •Using the Analysis Tools
- •Introducing the Analysis ToolPak Tools
- •Introducing VBA Macros
- •Displaying the Developer Tab
- •About Macro Security
- •Saving Workbooks That Contain Macros
- •Two Types of VBA Macros
- •Creating VBA Macros
- •Learning More
- •Overview of VBA Functions
- •An Introductory Example
- •About Function Procedures
- •Executing Function Procedures
- •Function Procedure Arguments
- •Debugging Custom Functions
- •Inserting Custom Functions
- •Learning More
- •Why Create UserForms?
- •UserForm Alternatives
- •Creating UserForms: An Overview
- •A UserForm Example
- •Another UserForm Example
- •More on Creating UserForms
- •Learning More
- •Why Use Controls on a Worksheet?
- •Using Controls
- •Reviewing the Available ActiveX Controls
- •Understanding Events
- •Entering Event-Handler VBA Code
- •Using Workbook-Level Events
- •Working with Worksheet Events
- •Using Non-Object Events
- •Working with Ranges
- •Working with Workbooks
- •Working with Charts
- •VBA Speed Tips
- •What Is an Add-In?
- •Working with Add-Ins
- •Why Create Add-Ins?
- •Creating Add-Ins
- •An Add-In Example
- •System Requirements
- •Using the CD
- •What’s on the CD
- •Troubleshooting
- •The Excel Help System
- •Microsoft Technical Support
- •Internet Newsgroups
- •Internet Web sites
- •End-User License Agreement
Part IV: Using Advanced Excel Features
Working with External Reference Formulas
This section discusses some key points that you need to know about when working with links. Understanding these details can help prevent some common errors.
Creating links to unsaved workbooks
Excel enables you to create link formulas to unsaved workbooks (and even to nonexistent workbooks). Assume that you have two workbooks open (Book1 and Book2), and you haven’t saved either of them. If you create a link formula to Book1 in Book2 and then save Book2, Excel displays the confirmation dialog box shown in Figure 27.1.
Typically, you don’t want to save a workbook that has links to an unsaved document. To avoid this prompt, save the source workbook first.
FIGURE 27.1
This confirmation message indicates that the workbook you’re saving contains references to a workbook that you haven’t yet saved.
You also can create links to documents that don’t exist. You may want to do so if you’ll be using a source workbook from a colleague, but the file hasn’t yet arrived. When you enter an external reference formula that refers to a nonexistent workbook, Excel displays its Update Values dialog box, which resembles the Open dialog box. If you click Cancel, the formula retains the workbook name that you entered, but it returns a #REF! error.
When the source workbook becomes available, you can choose File Info Related Documents Edit Links to Files to update the link; see “Updating links,” later in this chapter) After doing so, the error goes away, and the formula displays its proper value.
Opening a workbook with external reference formulas
When you open a workbook that contains links, Excel displays a dialog box (shown in Figure 27.2) that asks you what to do.
•Update: The links are updated with the current information in the source file(s).
•Don’t Update: The links are not updated, and the workbook displays the previous values returned by the link formulas.
•Help: The Excel Help screen displays so you can read about links.
592
Chapter 27: Linking and Consolidating Worksheets
Security Warning for Links
Excel 2010 features a new security feature. The first time you open a workbook that contains links to other files, you see a security warning below the Ribbon. The links will not be updated unless you click the Enable Content button.
However, Excel remembers that you’ve deemed the workbook safe, so you won’t see that Security Warning again. If you would like to disable these Security Warnings, use the External Content tab of the Trust Center dialog box and change the option for Security Settings for Workbook Links. To display this dialog box, choose File Options. Then click the Trust Center tab, and click the Trust Center Settings button.
What if you choose to update the links, but the source workbook is no longer available? If Excel can’t locate a source workbook that’s referred to in a link formula, it displays its Edit Links dialog box, shown in Figure 27.3. Click the Change Source button to specify a different workbook, or click the Break Link to destroy the link.
Note
You can also access the Edit Links dialog box by choosing File Info Related Documents Edit Links to Files. The dialog box that appears lists all source workbooks, plus other types of links to other documents. n
FIGURE 27.2
Excel displays this dialog box when you open a workbook that contains links to other files.
593
Part IV: Using Advanced Excel Features
FIGURE 27.3
The Edit Links dialog box.
Changing the startup prompt
When you open a workbook that contains one or more external reference formulas, Excel, by default, displays the dialog box (shown in Figure 27.2) that asks how you want to handle the links. You can eliminate this prompt by changing a setting in the Startup Prompt dialog box (see Figure 27.4).
To display the Startup Prompt dialog box, choose File Info Related Documents Edit Links to Files, which displays the Edit Links dialog box (refer to Figure 27.3). There, click the Startup Prompt button and then select the option that describes how you want to handle the links.
FIGURE 27.4
Use the Startup Prompt dialog box to specify how Excel handles links when the workbook is opened.
Updating links
If you want to ensure that your link formulas have the latest values from their source workbooks, you can force an update. For example, say that you just discovered that someone made changes to the source workbook and saved the latest version to your network server. In such a case, you may want to update the links to display the current data.
To update linked formulas with their current value, open the Edit Links dialog box (choose File Info Related Documents Edit Links to Files), choose the appropriate source workbook in the
594
Chapter 27: Linking and Consolidating Worksheets
list, and then click the Update Values button. Excel updates the link formulas with the latest version of the source workbook.
Note
Excel always sets worksheet links to the Automatic Update option in the Edit Links dialog box, and you can’t change them to Manual, which means that Excel updates the links only when you open the workbook. Excel doesn’t automatically update links when the source file changes (unless the source workbook is open). n
Changing the link source
In some cases, you may need to change the source workbook for your external references. For example, say you have a worksheet that has links to a file named Preliminary Budget, but you later receive a finalized version named Final Budget.
You can change the link source using the Edit Links dialog box (choose File Info Related Documents Edit Links to Files). Select the source workbook that you want to change and click the Change Source button. Excel displays its Change Source dialog box, from which you can select a new source file. After you select the file, all external reference formulas that referred to the old file are updated.
Severing links
If you have external references in a workbook and then decide that you no longer need the links, you can convert the external reference formulas to values, thereby severing the links. To do so, access the Edit Links dialog box (choose File Info Related Documents Edit Links to Files), select the linked file in the list, and then click Break Link.
Caution
Excel prompts you to verify your intentions because you can’t undo this operation. n
Avoiding Potential Problems with
External Reference Formulas
Using external reference formulas can be quite useful, but the links may be unintentionally severed. As long as the source file hasn’t been deleted, you can almost always re-establish lost links. If you open the workbook and Excel can’t locate the file, you see a dialog box that enables you to specify the workbook and re-create the links. You also can change the source file by using the Change Source button in the Edit Links dialog box. The following sections discuss some pointers that you must remember when you use external reference formulas.
595
Part IV: Using Advanced Excel Features
Renaming or moving a source workbook
If you rename the source document or move it to a different folder, Excel won’t be able to update the links. You need to use the Edit Links dialog box and specify the new source document. See “Changing the link source,” earlier in this chapter.
Note
If the source and dependent folder reside in the same folder, you can move both of the files to a different folder. In such a case, the links remain intact. n
Using the Save As command
If both the source workbook and the dependent workbook are open, Excel doesn’t display the full path to the source file in the external reference formulas. If you use the File Save As command to give the source workbook a new name, Excel modifies the external references to use the new workbook name. In some cases, this change may be what you want. But in other cases, it may not.
Here’s an example of how using File Save As can cause a problem: You finished working on a source workbook and save the file. Then you decide to be safe and make a backup copy on a different drive, using File Save As. The formulas in the dependent workbook now refer to the backup copy, not the original source file. This is not what you want.
Bottom line? Be careful when you choose File Save As with a workbook that is the source of a link in another open workbook.
Modifying a source workbook
If you open a workbook that is a source workbook for another workbook, be extremely careful if the dependent workbook isn’t open. For example, if you add a new row to the source workbook, the cells all move down one row. When you open the dependent workbook, it continues to use the old cell references — which is probably not what you want.
Note
It’s easy to determine the source workbooks for a particular dependent workbook: Just examine the files listed in the Edit Links dialog box (choose File Info Related Documents Edit Links to Files). However, it’s not possible to determine whether a particular workbook is used as the source for another workbook. n
You can avoid this problem in the following ways:
•Always open the dependent workbook(s) when you modify the source workbook. If you do so, Excel adjusts the external references in the dependent workbook when you make changes to the source workbook.
•Use names rather than cell references in your link formula. This approach is the safest.
596