- •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
Understanding the Different Web Formats
You can save an Excel workbook so that it’s viewable in a Web browser. When you save an Excel workbook for viewing on the Web, you have two options:
•An HTML file: Produces a static Web page, plus a folder that contains support files. You can create the HTML file from the entire workbook or from a specific sheet.
•A single file Web page: Produces a MIME HTML file (*.mht; *.mhtml). Not all browsers can open these files.
These options are described in the following sections. Both examples use a simple two-sheet workbook file. Each sheet has a table and a chart. Figure 28.1 shows one of these worksheets.
Keep in mind that these files are intended to be only displayed by a Web browser. They are not interactive files. In other words, the user cannot make any changes while viewing the file.
FIGURE 28.1
This workbook will be saved in Excel Web formats.
On the CD
This workbook, named webpage.xlsx, is available on the companion CD-ROM. n
606
Chapter 28: Excel and the Internet
Creating an HTML file
To save a workbook as an HTML file:
1.(Optional but recommended) Save the workbook as a normal Excel file.
2.Choose File Save As to display the Save As dialog box.
3.Select Web Page (*.htm; *.html) from the Save as Type drop-down list.
4.Specify what to save (either Entire Workbook or the active sheet).
5.Specify a filename and then choose a location for the file.
6.Click Save to create the HTML file. Excel may display a message warning you that some features in the workbook are not compatible with the Web page format. You can just ignore this message.
Caution
Although Excel can open the HTML files that it creates, essential information is lost. For example, formulas are lost, and charts appear as static graphic images. Therefore, if you might need to make changes later on, make sure you keep a copy of your work in a standard Excel file format. n
Figure 28.2 shows how Sheet1 of the example file looks in a browser: Firefox, in this case. Notice that the workbook’s sheet tabs appear along the bottom, and you can switch sheets just like you do in Excel.
In addition to the webpage1.htm file, Excel also created a folder named webpage1_files. This folder contains additional files that must be kept with the main HTML file. Therefore, if you post such a file on a Web server, don’t forget to also post the accompanying directory.
Creating a single file Web page
In the previous section, I discuss how creating an HTML file with Excel also creates a folder of additional files. The procedure for creating a Web page that uses a single file is exactly the same, except for Step 3. In Step 3, select Single File Web Page (*.mht; *.mhtml) from the Save as Type drop-down list.
Figure 28.3 shows the example file displayed in Internet Explorer.
Caution
As I mention previously, not all browsers can open single-file MHTM files. Two that can are Microsoft Internet Explorer (IE) and Opera. Other browsers (such as Firefox and Google Chrome) may require an add-on to display these files. n
607
Part IV: Using Advanced Excel Features
FIGURE 28.2
Viewing the HTML file in a browser.
Web Options
If you save your work in HTML format, you should be aware of some additional options. In the Save As dialog box, click Tools and then choose Web Options to display the Web Options dialog box. From this dialog box you can control some aspects of the HTML file, such as target browser version (Internet Explorer only), target monitor resolution, and fonts. Most of the time, the default settings work just fine. However, if you plan to save Excel files in HTML format, familiarizing yourself with the options available is worthwhile. These options are described in the Help system.
608
Chapter 28: Excel and the Internet
FIGURE 28.3
Viewing the single file Web page in Internet Explorer.
Opening an HTML File
Excel can open most HTML files, which can be stored on your local drive or on a Web server. Choose File Open and locate the HTML file. If the file is on a Web server, you’ll need to copy the URL and paste it into the File Name field in the Open dialog box.
How the HTML code renders in Excel varies considerably. Sometimes, the HTML file may look exactly as it does in a browser. Other times, it may bear little resemblance, especially if the HTML file uses Cascading Style Sheets (CSS) for layout.
After opening an HTML file, you can work with the information using the normal Excel tools.
Another way to open an HTML file from a Web server is to use a Web query, which is discussed later in this chapter (see “Using Web Queries”).
609