1. XP
Troubleshooting Workbooks and
Creating Excel Applications
Chapter 10
“For every failure, there’s an alternative course of action. You just have
to find it. When you come to a roadblock, take a detour.”
-Mary Kay Ash
2. XP
Chapter Introduction
• Information system
Collects, organizes, and processes data
Communicates and distributes coordinated results
• Decision support system (DSS)
Helps managers model business scenarios, especially
through what-if analysis
• Minimizing data-entry errors in Excel workbooks
• Documenting workbooks and troubleshooting
worksheet errors
3. XP
Chapter Introduction (continued)
• Automating tasks to further enhance usefulness and
reliability of workbooks
• Tools covered in this chapter: Data Validation,
Formula Auditing, Macro Recorder, Visual Basic
Editor
4. XP
Tools Covered in this Chapter
• Data Validation
• Formula Auditing
• Macro Recorder
• Visual Basic Editor
5. XP
Level 1 Objectives:
Preparing Error-Free Workbooks
• Plan an Excel application
• Validate data entry
• Protect workbooks
• Document workbooks
6. XP
Planning an Excel Application
• Workbooks designed so others can use them
• Usually a decision support system
Support decisions by allowing what-if analysis and
other types of data analysis
• Typically provide an easy-to-use interface
Custom buttons
Clearly written documentation
Instructions for entering data and performing
calculations
8. XP
Controlling Data-Entry Errors
Data validation
tool
• Creates rules that define what data is
valid in a particular cell
• Ensures that data entered in a cell
meets specified criteria
Validation rule • Specifies type of data that is appropriate
• Specifies range of acceptable values
Input message • Identifies kind of data user should enter
Error alert •Displays a message of varying severity
9. XP
Validating Data Using
the Data Validation Tool
1. Set up the data validation rule
2. Create the input message
3. Specify the error alert style and message
18. XP
Protecting Workbooks
• Ways to protect workbooks
Lock cells so users cannot change contents
Hide cells so users cannot see them
Specify which actions users can perform
Prevent a worksheet from being deleted from a
workbook
• Select appropriate level of protection (worksheet,
workbook, file)
19. XP
Locking and Unlocking Cells
• To allow users to change contents of unlocked cell,
but not the contents of locked cells:
Unlock cells you want users to change access
(Locked property of a cell)
Protect the worksheet to engage the Locked property
of the cells
21. XP
Protecting a Worksheet
• Users cannot change content of locked cells
• Specify what users can do in the worksheet (format,
enter data)
• Can specify passwords that users enter a case-
sensitive password before they remove protection
24. XP
Protecting a Workbook
• To prohibit users from adding, renaming, or deleting
worksheets in the workbook
• Secure workbook structure or its windows
Structure (cannot insert, delete, or rename worksheets)
Windows (Excel windows are same size and position
each time workbook opens)
• Can specify that users enter a case-sensitive
password before they remove protection
25. XP
Documenting Workbooks
• Documentation
All records that describe how and why a system has
been developed and how it should be used
Tremendous time-saver
Can include within a workbook or print workbook
information (documentation worksheet or workbook’s
formulas)
26. XP
Types of Documentation
for Excel Applications
• Basic information (workbook author, date of creation,
purpose)
• Step-by-step instructions for entering data and
performing calculations
• Notes or comments that identify the source of data
• Notes or comments that define terms, explain
calculations, describe assumptions
29. XP
Level 1 Summary
• Planning an Excel application that others can use
• Validating data entry
• Protecting a workbook
• Providing thorough documentation for users
Documentation worksheet
Cell comments
30. XP
Level 2 Objectives:
Preventing Errors in Formulas
• Audit formulas for accuracy and validity
• Evaluate and trace formula errors
• Identify, analyze, and correct errors
• Set error-checking options
31. XP
Auditing Formulas
• Taking advantage of more sophisticated Excel tools
that help find and respond to formula errors
Address error messages caused by problems with the
formulas in the workbook
Audit formulas
32. XP
Addressing Error Messages Caused
by Problems with Formulas
• Fix obvious errors
• Use the Error Alert button
• Examine the formula
33. XP
Using the Formula Auditing Tools
• Permit review of structure and behavior of formula
• Grouped on Formula Auditing toolbar
• May display tracer arrows
Precedent cells (contain a value used in a formula)
Dependent cells (contain a formula that refers to other
cells)
• Can result in false positives and false negatives
44. XP
Level 2 Summary
• Using Excel formula auditing tools to trace and
correct errors
Auditing formulas
Evaluating error messages in cells
45. XP
Level 3 Objectives:
Automating Excel Tasks
• Plan and record macros to automate repetitive tasks
and create Excel applications
• Run and test macros
• Add buttons to a worksheet
• Edit macros using the Visual Basic Editor
46. XP
Understanding Macros
• Series of commands that you store and then run
when you need to perform a task
• Steps – stored as Visual Basic for Applications (VBA)
commands in the macro – are performed in sequence
when you run the macro
• To create a macro
Use macro recorder, or
Write from scratch by entering VBA commands in the
Visual Basic Editor
47. XP
Recording a Macro
• Use macro recorder to record keystrokes and mouse
actions
• Assign a macro to a shortcut key
56. XP
Level 3 Summary
• Automating a workbook by creating and running a
macro
• Assigning a button to the macro to make it easy to
use
• Working in the Visual Basic Editor window to edit a
macro so it runs more efficiently
57. XP
Chapter Summary
• Creating an Excel application that functions as a
decision support system
Preparing error-free workbooks
Preventing errors in formulas
Automating Excel tasks