The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 11 Developing Applications Using Excel Microsoft Office Excel 2003
©2005 The McGraw-Hill Companies, Inc. All rights reserved Planning a Workbook Application To be successful as a spreadsheet developer, place yourself in the users’ position and strive to meet their expectations. Before you enter even the first label on a worksheet, understand your target audience and identify their basic input and output requirements. The users for your workbook application are the people who will enter and manipulate the data, analyze calculated results, and make decisions based on its reports and charts. They are also, most likely, the people paying your salary!
©2005 The McGraw-Hill Companies, Inc. All rights reserved Creating Shared Workbook Figure 11.1 Opening the EX1110 workbook The OrderForm worksheet draws data from the PriceList and Suppliers worksheet lists These worksheet lists are used for populating the OrderForm worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Creating Shared Workbook Figure 11.2 Share Workbook dialog box: Advanced tab Select the interval frequency for displaying changes made by other users Select whether to store a change history for the workbook (recommended) Specify the method for dealing with change conflicts between users Specify the settings to save in the custom view for each user
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracking Changes to a Workbook Figure 11.3 Highlight Changes dialog box
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracking Changes to a Workbook Figure 11.4 Tracking changes in a shared workbook A ScreenTip, colored row number and column letter, triangular cell indicator, and a cell outline highlight the changed cell
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracking Changes to a Workbook Figure 11.5 History worksheet showing tracked changes Excel 2003 inserts and populates a new History worksheet with the changes that have been tracked in the shared workbook Use the AutoFilter drop-down arrows to limit the display of information in the History worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracking Changes to a Workbook Figure 11.6 Select Changes to Accept or Reject dialog box
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracking Changes to a Workbook Figure 11.7 Accept or Reject Changes dialog box
©2005 The McGraw-Hill Companies, Inc. All rights reserved Merging Workbook Revisions Figure 11.8 Selecting multiple workbook files to compare and merge
©2005 The McGraw-Hill Companies, Inc. All rights reserved Merging Workbook Revisions Figure 11.9 Reviewing tracked changes after merging workbooks
©2005 The McGraw-Hill Companies, Inc. All rights reserved Merging Workbook Revisions Figure Displaying the History tracking worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Validating data Validating data that is entered into a worksheet ensures the reliability and accuracy of a workbook application. In addition to displaying drop-down lists of values, Excel 2003’s data validation feature provides helpful prompts and can even warn users when incorrect entries are made. As a workbook developer, it is your job to determine what data is valid by setting a numeric or date range or by comparing an entry to a list of acceptable values. This module presents several techniques for ensuring the completeness and accuracy of data.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying Conditional Formatting Figure Opening the EX1120 workbook
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying Conditional Formatting Figure Conditional Formatting dialog box Specify a condition by first selecting “Cell Value Is” or “Formula Is” Preview the formatting options selected Select the formatting to apply if the current condition evaluates to true Specify up to three conditions
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying Conditional Formatting Figure Specifying a condition based on a cell value
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying Conditional Formatting Figure Specifying a condition based on a formula
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying Conditional Formatting Figure Applying conditional formatting a worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying and Removing Validation Rules Figure Data Validation dialog box: Settings tab
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying and Removing Validation Rules Figure Data Validation dialog box: Input Message tab
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying and Removing Validation Rules Figure Data Validation dialog box: Error Alert tab
©2005 The McGraw-Hill Companies, Inc. All rights reserved Applying and Removing Validation Rules Figure Displaying a custom warning message Displays the text entered on the Error Alert tab of the Data Validation dialog box Displays the text entered on the Input Message tab of the Data Validation dialog box
©2005 The McGraw-Hill Companies, Inc. All rights reserved Finding and Copying Validation Rules Figure Go To Special dialog box Select the Data validation option button and then All or Same to locate validation rules in your worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Finding and Copying Validation Rules Figure Paste Special dialog box
©2005 The McGraw-Hill Companies, Inc. All rights reserved Using Dynamic Ranges For Data Validation Figure Creating a dynamic range reference
©2005 The McGraw-Hill Companies, Inc. All rights reserved Using Dynamic Ranges For Data Validation Figure Using a dynamic range in a validation rule
©2005 The McGraw-Hill Companies, Inc. All rights reserved Auditing a Worksheet To audit a worksheet means to review it for incorrect or suspect entries and formulas. Although conditional formatting and data validation provide some measure of error checking, mistakes can still occur when you construct and use a worksheet. For these instances, Excel 2003 offers several auditing features to assist you in tracking down rogue cells. Microsoft Office Excel 2003 also provides cell indicators and option buttons to assist you in performing error checking. In this module, you learn to use various auditing tools to find errors and graphically display cell dependencies.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Identifying Cell Indicators, Option Buttons, and Smart Tags Figure Opening the EX1131 workbook
©2005 The McGraw-Hill Companies, Inc. All rights reserved Identifying Cell Indicators, Option Buttons, and Smart Tags Figure Using the Insert Options button When you insert a new row, the formatting from the topmost row is applied to the new row. The Insert Options button appears to speed the process of changing this formatting assumption.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Identifying Cell Indicators, Option Buttons, and Smart Tags Figure AutoCorrect dialog box: Smart tags tab Select this check box to enable smart tags This list area displays the available libraries of keyword “recognizers.” You can activate the built-in lists independently for identifying cells containing dates, financial symbols, Outlook recipients, and other items Select this check box to store the identified smart tags in the workbook Check the current workbook for cell data recognized as smart tag labels Access the Microsoft Web site to download additional libraries of keyword recognizers
©2005 The McGraw-Hill Companies, Inc. All rights reserved Identifying Cell Indicators, Option Buttons, and Smart Tags Figure Displaying the Smart Tag Actions menu “MSFT” is recognized as a stock symbol and labeled with a smart tag cell indicator Click the Smart Tag Actions button to display a context-sensitive menu
©2005 The McGraw-Hill Companies, Inc. All rights reserved Identifying Cell Indicators, Option Buttons, and Smart Tags Figure Retrieving stock information from the Web using a smart tag Each blue underlined term is a hyperlink that you click to launch your default browser and display a Web page The stock information is placed on a new worksheet. The original data remains unchanged on the Sheet1 worksheet tab
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Invalid Data Using The Formula Auditing ToolBar Figure Opening the EX1130 workbook
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Invalid Data Using The Formula Auditing ToolBar Figure Formula Auditing toolbar
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Invalid Data Using The Formula Auditing ToolBar Figure Auditing a worksheet for non- complying values Because this value does not comply with the data validation rule specified, it appears highlighted using a red auditing circle Formula Auditing toolbar
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracing Precedents and Dependents Figure Tracing precedents for a formula Each circle endpoint shows a cell that provides precedent information for the selected formula
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracing Precedents and Dependents Figure Tracing immediate and associated precedents
©2005 The McGraw-Hill Companies, Inc. All rights reserved Tracing Precedents and Dependents Figure Tracing dependents in a worksheet Each arrowhead endpoint shows a cell that is dependent on the selected cell for information
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Errors In Formulas Figure Error Checking dialog box A “Divide by Zero Error” has been found in cell F14. Notice that the formula is also displayed above the error description
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Errors In Formulas Figure Evaluate Formula dialog box The next expression to be evaluated is shown in the Evaluation area The formula error checker already knows that an error will result in the next calculation
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Errors In Formulas Figure Displaying the Watch Window Drag the borderlines to size the columns
©2005 The McGraw-Hill Companies, Inc. All rights reserved Locating Errors In Formulas Figure Tracing calculation errors using the Watch Window
©2005 The McGraw-Hill Companies, Inc. All rights reserved Preventing Calculation Errors Figure Nesting an ISERROR function within an IF function Drag the borderlines to size the columns.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Automating A Workbook Excel 2003 has assigned most monotonous tasks to toolbar buttons and “Auto” commands. However, there are still tasks that you will have to perform over and over again that are not included as buttons on a toolbar. Excel 2003 allows you to store and play back keystrokes and commands. In addition to saving you an enormous amount of time, these stored instructions, called macros, also improve the consistency and accuracy of repetitive procedures. Using a macro, you can execute a sequence of instructions by simply clicking a button, pressing a key combination, or selecting a name from a list box.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Recording a Macro Figure Record macro dialog box Provide a shortcut key for executing the macro quickly Provide a descriptive one-word name for the macro Select a storage location for the macro. Where you store a macro determines its availability to other workbooks Enter a description specifying the purpose of the macro. Excel 2003 enters a description like this one automatically
©2005 The McGraw-Hill Companies, Inc. All rights reserved Recording a Macro Figure Completing the Record Macro dialog box Select a storage location for the macro. Where you store a macro determines its availability to other workbooks.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Recording a Macro Figure Recording cell formatting commands Stop Recording toolbar “Recording” status
©2005 The McGraw-Hill Companies, Inc. All rights reserved Playing Back a Macro Figure Macro dialog box All of the macros stored in the Macros in selection appear in this list box Select which macros to view in the list box A description of the currently selected macro is displayed
©2005 The McGraw-Hill Companies, Inc. All rights reserved Playing Back a Macro Figure Executing a macro to enter a business name and address All of the macros stored in the Macros in selection appear in this list box.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Protecting Yourself From Macro Viruses Figure Security dialog box: Security Level tab Most users will specify the “Medium” security setting if they also have antivirus software installed on their system. If you do not have a virus scanner, consider selecting the High or Very High security For more information about security settings, trusted publishers, and digital signing, click the Help button in the Title bar This computer has a virus scanner installed
©2005 The McGraw-Hill Companies, Inc. All rights reserved Protecting Yourself From Macro Viruses Figure Opening a workbook containing macros
©2005 The McGraw-Hill Companies, Inc. All rights reserved Protecting Yourself From Macro Viruses Figure Opening a workbook and running macros
©2005 The McGraw-Hill Companies, Inc. All rights reserved Editing a Recorded Macro Figure Displaying macro code in the Visual Basic Editor Code window Macro name The Code window contains the VBA programming code Comment
©2005 The McGraw-Hill Companies, Inc. All rights reserved Editing a Recorded Macro Figure Editing VBA programming code
©2005 The McGraw-Hill Companies, Inc. All rights reserved Printing Your Macros Figure Print dialog box in the Visual Basic Editor Specify whether to print the selected code, the entire module, or all the modules in the current project When printing a custom form, you can specify whether to print its image, in addition to its code
©2005 The McGraw-Hill Companies, Inc. All rights reserved Customizing Menus and ToolBars When Microsoft Office Excel 2003 is first installed on your system, the Menu bar, shortcut menus, and toolbars are set up in a default configuration. As you gain experience with Excel 2003 and create macros for automating everyday procedures, you may want to customize the application window to your preferred way of working. Fortunately, Excel 2003’s environment is extremely flexible and easily changed. You can change the number of worksheets that are displayed in a new workbook. You can even modify the existing interface elements, such as the Menu bar, and create entirely new menu options and toolbars. Whatever your requirements, your overall objective should be to make it easier to access the commands and procedures you use most often.
©2005 The McGraw-Hill Companies, Inc. All rights reserved Modifying the Menu Bar Figure Customize dialog box: Commands tab The Categories list box provides options similar to the topmost items on the Menu bar The Commands list box displays the commands available within the selected category
©2005 The McGraw-Hill Companies, Inc. All rights reserved Modifying the Menu Bar Figure Adding a new item to the menu Dragging the “Custom Menu Item” to the bottom of the Insert menu
©2005 The McGraw-Hill Companies, Inc. All rights reserved Modifying the Menu Bar Figure Assigning a macro to the new “Insert Business Name” menuitem
©2005 The McGraw-Hill Companies, Inc. All rights reserved Manipulating Toolbars Figure Floating the Standard toolbar The move handle for the Formatting toolbar The Standard toolbar appears as a floating window with a Title bar and Close button
©2005 The McGraw-Hill Companies, Inc. All rights reserved Manipulating Toolbars Figure Displaying and hiding toolbars
©2005 The McGraw-Hill Companies, Inc. All rights reserved Customizing a Toolbar Figure Removing a button from the Formatting toolbar Dragging the Bold button from the Formatting toolbar into the worksheet
©2005 The McGraw-Hill Companies, Inc. All rights reserved Customizing a Toolbar Figure Adding a button to the Standard toolbar Dragging the “Publish as Web Page” option to the left of the Print button
©2005 The McGraw-Hill Companies, Inc. All rights reserved Creating a New Toolbar Figure Changing a toolbar button’s image