Document

Exploring Microsoft Office
Excel 2010
INSERT
BOOK
COVER
by Robert Grauer, Keith Mulbery,
and Mary Anne Poatsy
Chapter 11
Templates, Styles, & Macros
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
1
Objectives
•
•
•
•
Select a template
Apply themes and backgrounds
Apply cell styles
Create and use a template
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
2
Objectives (continued)
•
•
•
•
Protect a cell, a worksheet, and a workbook
Create a macro
Create macro buttons
Set macro security
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
3
Templates, Themes, and Styles
• Excel is the right tool to develop
consistently formatted workbooks
• Tools include:
– Templates
– Themes
– Backgrounds
– Styles
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
4
Select a Template
• Template — a special workbook file used
as a model to create similarly structured
workbooks
• Typically contains standard labels,
formulas, and formatting but little or no
data
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
5
Select a Template
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
6
Select a Template
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
7
Apply a Theme
• Theme — a collection of colors, fonts,
and special effects
• Some organizations have a style that
encompasses particular fonts, colors, and
a logo or trademark
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
8
Customize a Theme
• Three elements comprise a theme:
– Colors
– Fonts
– Effects
• Use the Themes group on the Page Layout
tab to customize your theme
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
9
Insert a Background
• Background — an image that appears
behind the worksheet data onscreen
– Does not print
• Insert an image as a watermark in a header
to have it appear on the printed page
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
10
Insert a Background
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
11
Apply Cell Style
• Cell style — a set of formatting options
applied to worksheet cells
• Changing the theme results in Excel
updating cells formatted by cell styles to
reflect the new theme
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
12
Apply Cell Styles
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
13
Create Custom Cell Style
To create a custom cell style:
•
•
•
•
•
Click the cell that contains the desired formatting
Click the Home tab and Cell Styles
Select New Cell Style
Type the name for your new style
Click the check boxes to select the style options
you want
• Click OK
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
14
Create Custom Cell Style
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
15
Edit/Remove Custom Cell Style
To modify a style:
• Right-click the style in the Custom section of the
Cell Styles gallery
• Select Modify
• Make the desired format changes
• Click OK
To delete a cell style:
• Right-click the style name in the Custom section of
the Cell Styles gallery
• Select Delete
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
16
Custom Templates and Workbook
Protection
• Templates save time when designing
workbooks
• You can create custom templates if
predefined ones do not meet your needs
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
17
Create a Template
•
•
•
•
Use descriptive labels, empty cells, and formulas
Use cell references in formulas where possible
Use an appropriate function to trap errors
Include data-validation settings and instructions
for the template
• Turn off worksheet gridlines, if desired
• Apply appropriate formatting
• Give worksheets meaningful names and delete
worksheets that are not used
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
18
Save a Template
To save a workbook as a template:
•
•
•
•
•
•
Click the File tab
Click Save & Send
Click Change File Type
Click Template
Click Save As
Select the location, enter a name, and click Save
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
19
Save to Template Gallery
To save your custom template to Template
Gallery:
1.
2.
3.
4.
Click the File tab
Click Save As
Click the Save as type arrow
Select Excel Template
— Excel then selects the
C:\...\Templates folder automatically
5. Enter a name and click Save
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
20
Protect a Template
• Excel permits you to protect a cell, a
worksheet, and a workbook
• Design your template to enable users to
change only the necessary cells in a
worksheet
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
21
Lock and Unlock Cells
• Locked cells prevent users from making
changes to that cell in a protected
worksheet
• Locked cells are not protected until you
protect the worksheet
• Unlock cells requiring user input before
protecting the workbook
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
22
Lock and Unlock Cells
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
23
Protect a Worksheet
• Create passwords you can remember
– Up to 255 characters
– Combination of letters, numbers, and symbols
• Use upper and lower case
– Passwords are case sensitive
• Store your password in a secure location
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
24
Protect a Worksheet
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
25
Unprotect a Worksheet
To unprotect a worksheet:
• Click Unprotect Sheet in the Changes group on
the Review tab, OR
• Click Format in the Cells group on the Home
tab; then select Unprotect Sheet
• Type the password in the Password box; then
click OK
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
26
Protect a Workbook
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
27
Unprotect a Workbook
To unprotect a workbook:
•
•
•
•
Click the Review tab
Click Protect Workbook
Type the password
Click OK
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
28
Macros
• Macro — a set of instructions that tells
Excel which commands to execute
– A macro is your personal assistant
• File formats that support macros include:
– Excel Macro-Enabled Workbook (.xlsm)
– Excel Binary Workbook (.xlsb)
– Excel Macro-Enabled Template (.xltm)
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
29
Create a Macro
• Macro Recorder — a tool for recording a
sequence of commands and converting
them into programming syntax
• Remember:
– It records every action taken
– Practice the steps before recording
– Make them broad
– Use the correct cell references
• Relative, absolute, or mixed
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
30
Use the Macro Recorder
Access the Macro Recorder by:
– View tab contains the Macros group with the
macros command
– Developer tab (when displayed)
– Status bar which can display the Macro recording
button
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
31
Display Developer Tab
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
32
Add Macro Recording to Status Bar
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
33
Record a Macro
1. Click the View tab
2. Click the Macros arrow in the Macros
group
3. Select Record
4. Type a name for the macro
5. Type a keyboard shortcut if desired
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
34
Record a Macro (continued)
6. Click Store macro in arrow and select a
location
7. Type a description and purpose
8. Click OK
9. Perform the commands
10. Click View tab, Macros in the macros
group, and then Stop Recording
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
35
Record a Macro
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
36
Run a Macro
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
37
Run a Macro
To run a macro:
1. Select the location where you will test the
macro
2. Click the View tab
3. Click the Macros arrow in the Macros group
4. Select View Macros
5. Select the macro
6. Click Run
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
38
Edit a Macro in VBA Editor
• Visual Basic for Applications (VBA) — an
Office application used to create, edit, execute,
and debug macros using programming language
• Procedure — a named sequence of statements
that execute as one unit
• Keyword — a special programming syntax used
for a specific purpose
• Comment — documents programming code
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
39
Code in VBA Editor
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
40
Create Macro Buttons
To add a macro button to a worksheet:
1.
2.
3.
4.
Click the Developer tab
Click Insert in the Controls group
Click Button (Form Control)
Drag the crosshair pointer to draw the button
on the worksheet
5. Select the macro to assign to the button and
click OK
6. Edit the button text and click the worksheet
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
41
Form Controls
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
42
Macro Security
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
43
Set Macro Security
To open the Trust Center:
1. Click the File tab
2. Click Options
3. Click Trust Center on the left side of the Excel
Options dialog box
4. Click Trust Center Settings
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
44
Trust Center Dialog Box
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
45
Summary
In this chapter you learned how to:
• Select, create and use a template
• Apply themes and backgrounds
• Apply cell styles
• Protect a cell, worksheet, and workbook
• Work with macros
– Create macros and macro buttons
– Set macro security
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
46
Questions
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
47
Copyright
All rights reserved. No part of this publication may be reproduced, stored in
a retrieval system, or transmitted, in any form or by any means, electronic,
mechanical, photocopying, recording, or otherwise, without the prior written
permission of the publisher. Printed in the United States of America.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
48