0% found this document useful (0 votes)
168 views

Excel 2019 Level 3

Uploaded by

Ammar Ibrahim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
168 views

Excel 2019 Level 3

Uploaded by

Ammar Ibrahim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 214

Excel 2019

Level 3

The Computer Workshop, Inc.

800-639-3535
www.tcworkshop.com
[email protected]
Lesson Notes
Excel 2019

Level 3

Course Number: 0200-300-19-W


Course Release Number: 1.0
Software Release Number: 2019

11/11/2019

Developed by:
Brian Ireson
Suzanne Hixon
Thelma Tippie

Edited by:
Marissa Kain, Jeffrey DeRamus and Cheri Stevenson

Published by:
RoundTown Publishing
5200 Upper Metro Place, Suite 140
Dublin, Ohio 43017

for

The Computer Workshop, Inc.


5200 Upper Metro Place, Suite 140
Dublin, Ohio 43017
(614) 798-9505

Copyright © 2019 by RoundTown Publishing. No reproduction or transmittal of any part of this publication,
in any form or by any means, mechanical or electronic, including photocopying, recording, storage in an
information retrieval system, or otherwise, is permitted without the prior consent of RoundTown Publishing.

Disclaimer:
Round Town Publishing produced this manual with great care to make it of good quality and accurate, and
therefore, provides no warranties for this publication whatsoever, including, but not limited to, the implied
warranties of merchantability or fitness for specific uses. Changes may be made to this document without
notice.

Trademark Notices:
The Computer Workshop, Inc. and The Computer Workshop logo are registered trademarks of The
Computer Workshop, Inc. [Microsoft], [Windows], [PowerPoint], [Excel], [Word], and [Access] are registered
trademarks of Microsoft Corporation. [Photoshop] and [InDesign] are a registered trademark of Adobe. All
other product names and services identified throughout this book are trademarks or registered trademarks
of their respective companies. Using any of these trade names is for editorial purposes only and in no way is
intended to convey endorsement or other affiliation with this manual.
Preface

Table of Table of Contents.................................................................... iv


Using this Manual................................................................viii
Contents To Download Data Files................................................viii
Conventions............................................................................ ix
Conventions Used in this Manual................................. ix

Lesson 1: Macros and VBA


What is a Macro?......................................................................3
Saving Files with Macros........................................................3
Developer Ribbon....................................................................4
Adding the Developer Tab................................................4
Macro Security....................................................................5
Macro Security..........................................................................5
Macro Naming..........................................................................8
Macro Naming Rules.........................................................8
Understanding Macro Referencing.................................9
Macro Referencing...................................................................9
Recording a Macro.................................................................10
Creating a Macro Using the View Tab..........................10
Creating a Macro Using the Developer Tab.................11
Running a Macro....................................................................14
Run a Macro Using the Macro Dialog Box...................14
Editing a Macro......................................................................16
Visual Basic for Applications..........................................16
Recording a Macro in the Personal Workbook..................20
Personal Macro Workbooks............................................20
Saving a Macro in the Personal Macro Workbook......20
Running a Personal Macro Workbook Macro...................24
Using a Personal Macro..................................................24
Editing Personal Macros.......................................................25
Accessing the Personal Macro Workbook....................25
Editing the Personal Macro............................................25
Adding a Macro Button to the QAT....................................28
To Add a Macro Button to the QAT..............................28
To Change the Appearance of the Button....................29
Recording a Relative Reference Macro...............................31
Relative Reference Macros..............................................31
Removing A Personal Macro................................................34
Removing a Personal Macro Workbook Macro...........34
Resetting the Default Workbook....................................36

Lesson 2: Form Controls


Form Controls.........................................................................41
What is a Form Control?.................................................42
Adding Form Controls..........................................................44

Page iv Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Preface

Table of Adding a Form Control to a Worksheet.......................44


Modifying Form Controls.....................................................46
Contents, Adding a Combo Box............................................................52
continued The Combo Box Control..................................................52
Adding A Group Box............................................................56
Adding the Group Box Control.....................................56
Adding Option Button Controls....................................57
Adding An Option Button....................................................57
Adding Functionality to the Option Buttons...............58
Adding A Button....................................................................62
The Button Form Control................................................62
Assigning a Macro to a Form Control...........................63
Assigning a Macro to a Form Control.................................63

Lesson 3: Hyperlinks and Connecting to the Internet


What is a Hyperlink...............................................................71
What is a Hyperlink?.......................................................71
Creating a Hyperlink.............................................................72
Inserting Hyperlinks........................................................72
Link to Existing File or Web Page..................................73
Link to Place in this Document......................................74
Link to Create New Document......................................74
To Follow a Hyperlink in Excel.....................................75
Modifying Hyperlinks...........................................................82
Modifying Hyperlinks.....................................................82
Changing the Attributes of the Selected Hyperlink....82
Changing the Attributes of All Hyperlinks..................83
Querying Data from a Web Site...........................................85
New Query from Web.....................................................85
Editing A Query.....................................................................89
Removing Unnecessary Data from a Query................89
Splitting a Column...........................................................91
Refreshing the Data.........................................................91

Lesson 4: Outlining, Subtotals, and Consolidation


Outlining.................................................................................97
Automatic Outlining..............................................................98
Using an Automatic Outline ..........................................98
Exploring Outlined Data.......................................................99
Showing or Hiding Outlined Data................................99
Removing an Automatic Outline.................................100
Grouping Data Manually....................................................103
To Manually Outline Data............................................103
To Remove Manual Groupings....................................103
Creating Subtotals................................................................106

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page v


Preface

Table of Using the Subtotal Feature...........................................106


Removing Subtotals.......................................................107
Contents, Consolidating Workbooks..................................................111
continued To Consolidate Workbooks..........................................112

Lesson 5: Analytical Tools


Goal Seek...............................................................................119
To use Goal Seek............................................................119
Data Tables............................................................................123
Creating a One-Input Data Table:................................123
Two-Input Data Table....................................................127
Scenarios................................................................................130
Adding Scenario's..........................................................130
Showing Scenarios.........................................................132
Editing a Scenario..........................................................135
Removing Scenarios......................................................135
Solver.....................................................................................137
Installing the Solver Add-in.........................................137
Using Solver ..................................................................139
Forecasting............................................................................147
Create a Simple Forecast...............................................147
Customizing the Forecast.............................................148

Appendix A: The Default Workbook and Theme


Lesson Overview............................................................ A1
The Default Workbook........................................................ A3
Settings That Can Be Saved in a Template................. A3
Saving Cell Styles to the Default Workbook.............. A3
Excel Styles............................................................................ A7
Changing the Theme of a Workbook.......................... A8
Changing the Colors in a Workbook Theme............. A8
Changing the Font in a Workbook Theme................. A8
Saving a Custom Theme............................................... A9

Appendix B: Querying a Website with Excel 2016


Querying Data from a Web Site.......................................... B3
New Query from Web.................................................... B3
Editing A Query.................................................................... B7
Removing Unnecessary Data from a Query............... B7
Splitting a Column.......................................................... B9
Refreshing the Data........................................................ B9

Appendix C: 2016-Sharing and Linking Workbooks


Lesson Overview.............................................................C1

Page vi Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Preface

Table of Shared Workbooks................................................................C3


Sharing a Workbook.............................................................C4
Contents, Sharing Limitations........................................................C4
continued How to Share a Workbook............................................C5
Opening and Editing a Shared Workbook..................C7
Tracking Changes.................................................................C9
Tracking Changes...........................................................C9
User Credentials for Tracking Changes.......................C9
Highlighting Changes....................................................C9
The History worksheet.................................................C11
Adding the History Worksheet...................................C11
Resolving Conflicts ............................................................C14
Resolving Conflicts a Shared Workbook ..................C14
Accepting and Rejecting Changes....................................C16
Accepting and Rejecting Changes..............................C16
Protecting Shared Workbooks..........................................C19
Protecting a Shared Workbook...................................C19

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page vii


Preface

Using this Welcome to the Excel 2019 Level 3 course. This manual and
the data files are designed to be used for learning, review and
Manual reference after the class. The data files can be downloaded any
time from The Computer Workshop website:
http:\\www.tcworkshop.com
There is no login or password required to access these files. You
will also find handouts and supplementary materials on the
website in the Download section.

To Download Data Files

Once on The Computer Workshop website, locate and click the


Student Resources link in the top navigation bar. When on the
Student Resources page, click the Data Files button.
1. Data Files page displays a list of general application types.
2. Click once on the Microsoft Office Courses link.
3. Click once on the software related to the course.
4. Click once on the version related to the course.
5. If there are multiple folders, click on the TCW folder.
6. Click on the course name to download the data files.

You can choose to open or save the zipped folders content to


your computer.

While on the Student Resources page, you can also access


handouts by clicking the Handouts button. Handouts are in
PDF format and also available to you without login or password.
Simply open the PDF and either print or save to your computer.

Page viii Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Preface

Conventions Conventions Used in this Manual

The hands-on exercises (Actions) are written in a two-column


format. The left column (“Instructions”) gives numbered
instructions, such as what to type, keys to press, commands
to choose from menus, etc. The right column (“Results/
Comments”), contains comments describing results of, reasons
for, quick keys, etc. for the instructions listed on the left.

› Key names and Functions are bold and enclosed in


square brackets:
[Enter], [Tab], [F5], [F10]
› Keys you press simultaneously are separated by a plus
(+) sign, typed in bold and enclosed in square brackets.
You do not press the plus.
[Shift + F5]
› Keys you press in sequence are separated by a space,
bold and enclosed in square brackets.
[Home] [Down Arrow]
› Ribbon tab names are in bold and italic: Example:
Home
› Group names are in bold: Example: Font
› Dialog box names are in italic: Example: Save As
› Button names are bold and enclosed in square brackets:
Example: [Sort]
› Information you are to type will be in bold. Example:
This is the first day of the rest of your life.
› Information that you need to supply will be indicated
with pointed brackets. Example: Type: < your name >.

Page ix Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Lesson 1: Macros and


VBA
Lesson Overview

You will cover the following concepts in this


chapter:
› What is a Macro? › Recording a Macro in the Personal
Workbook
› Saving Files with Macros
› Running a Personal Macro
› Developer Ribbon
Workbook Macro
› Macro Security
› Editing Personal Macros
› Macro Naming
› Adding a Macro Button to the QAT
› Macro Referencing
› Recording a Relative Reference
› Recording a Macro Macro
› Running a Macro › Removing A Personal Macro
› Editing a Macro
Lesson Notes
Lesson 1: Macros and VBA

What is a Macro? A Macro can be described as a tiny program that uses Visual
Basic code to automate a sequence of actions or instructions.
A Macro can be simple and consist of only a few tasks or
commands, or be quite complex, involving lots of data
manipulation and calculations. To create complex Macros, it is
worthwhile to invest time in learning Visual Basic programming.
But for simple Macros, you don’t have to do any programming at
all.

Simple Macros are great for any long sequence of keystrokes


that you find yourself repeating often; or for combinations of
basic Excel actions that would be convenient to automate for a
particular workbook. Macros can be saved with the workbook
in which they were created, or they can be saved in a separate
personal Macro workbook where they are accessible all of the
time.

As mentioned previously, Excel will record the actions you take


when creating a Macro and convert them into Visual Basic code.
This code contains all of the instructions that Excel needs to
execute your Macro.

Saving Files with Once you plan on creating Macros in a workbook, it must be
saved as a macro-enabled workbook. When performing a Save As
Macros choose the second option from the drop-down list within the Save
As Type field. The saved Excel workbook will have an extension
of .xlsm.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 3


Lesson 1: Macros and VBA

Developer Adding the Developer Tab


Ribbon It is not difficult to create a Macro in Excel, but to make the
controls easier to access, you should enable the Developer Tab.
This Developer Tab is your gateway to creating and editing
Macros in Excel 2019. If the Developer Tab is not showing on the
Ribbon, do the following:

› Select the File Tab


› Click the Options in the index on the left.
› Click the Customize Ribbon category on the left of the
Excel Options dialog.

› On the right in the Customize the Ribbon: list, click the


checkbox before Developer. A checkmark should be
added to the checkbox.
› Click [OK] to close the Excel Options dialog. The
Developer Tab now appears at the top of the Excel
screen.
› Click the Developer Tab to activate it.

Page 4 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA

Macro Security Macro Security


It is well known that VBA Macros can be a source or carrier
of computer viruses created by unscrupulous programmers.
Because of this, you should never use a Macro if you do not
know where it came from, and you should never open a
workbook that contains a Macro unless you trust the source of
the workbook.
Setting the Macro Security Level

› Select the Developer Tab.


› Click the [Macro Security] button.

› The Excel Trust Center dialog box will open.


› Click on Macro Settings on the left. Choose the option
best for you and click [OK].

- OR -
› Click on the File Tab.
› Select Options.
› Choose Trust Center from the index on the left.
› Click on the [Trust Center Settings] button.
› The Excel Trust Center dialog box will open.

› Click on Macro Settings on the left. Choose the option


best for you and click [OK].

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 5


Lesson 1: Macros and VBA

Macro Security, Option Descriptions


continued Disable all Macros Only the Macros stored in workbooks
without notification in a trusted location are allowed to run.
Security Alerts are also disabled.
Disable all Macros This is the default setting. Security
In Excel, Macros with notification Alerts are enabled. This allows you to
can clear all items choose which Macro to run.
from the undo list. Disable all Macros Only Macros that are digitally signed
Once a Macro has been
run, the steps cannot be
except digitally signed by a trusted publisher can run.
undone. Macros
Enable all macros Enables all Macros. Makes the
(not recommended; computer vulnerable to malicious code.
potentially dangerous
code can run)
Trust Access to the This option is mostly for developers.
VBA project object Selecting this option enables Macros to
Model access core VB objects, methods, and
properties, potentially exposing your
computer to viruses. If you find your
Macro will not work with this option
de-selected, move your file to a trusted
location, or add the folder to your
trusted locations. Otherwise, be sure
to de-select this option upon closing
your file.

Page 6 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Action 1.1 - Adding the Developer Tab

Instructions: Results/ Comments:


1. Start Excel. Notice there is no Developer A blank spreadsheet is opened, if not then
Tab. click the blank workbook option from the
list of templates.

2. Click the File Tab and choose Options The Excel Options dialog box opens.
from the categories listed on the left side
of the Backstage view.

3. Select Customize Ribbon from the Options related to customizing the ribbon
categories on the left. are displayed.

4. In the right list of Tabs, click the The Developer Tab will now be added to
checkbox next to Developer and click the the ribbon.
[OK] button.

5. Activate the Developer Tab on the ribbon. To view the Developer Ribbon.

6. Locate the Code Group. This group deals with creating and editing
Macros.

7. Locate the Controls Group. This group is used when creating Form
Controls.

8. Click the View Tab. The View Tab is active.

9. Locate the Macros Group. You can record and run Macros from this
menu as well as the Developer Tab.

10. Close the workbook without saving [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA, Page 7
Lesson 1: Macros and VBA

Macro Naming To create a Macro, you can either write it from scratch using
Visual Basic code, which can be considered programming, or
you can have Excel record the actions you perform, which in turn
creates the Visual Basic code for you. Recording is less efficient,
but much easier.

Before recording your Macro, it is a good idea to plan the process


you want to automate. Rehearsing the procedure will help
eliminate recording mistakes in the Macro.

Macro Naming Rules


You must adhere to the following rules when creating your
In newer versions Macros:
of Excel, it is
possible to record › The Macro name must start with a letter.
the formatting changes
to a Chart as a Macro › No spaces are allowed in the name. You may wish to
and then apply it to use the underscore instead of spaces.
another Chart.
› You can use letters, number and the underscore
character, but not other characters such as @, $, #, or ! .
› Make sure the name is unique and doesn't conflict with
the name of other objects or built-in Names in your
worksheet or workbook.
An error message will be given if these rules aren't followed,
letting you know you have an invalid procedure.
There can be only
one Macro named Auto-Run Macros
Auto_Open.
If you want your Macro to start as soon as you open your Excel
program, simply save it with the name Auto_Open.

Page 8 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA

Macro Understanding Macro Referencing


In earlier courses of Excel, you worked with cell referencing and
Referencing the same concept applies when creating Macros.

Absolute Referencing will record actions using the absolute


location of cells. This results in the Macro performing the actions
in the same cell reference regardless of the position of the cell
pointer.

For example, if you record a Macro to start in cell A1 and move


to cell D1, when running the Macro, if your active cell is G15 it
will go back to A1 and move the selection to D1.

Relative Referencing will record actions relative to the active cell


position. This results in the Macro measuring distance from the
starting point vs. exact cell location.

There are benefits to both methods. You must decide what is best
for your Macro. By default, Excel uses Absolute Referencing.

To Use Relative Referencing During Macro Recording

› Select the Developer Tab.


› In the Code Group.
Note
› Click the [Use Relative References] button.
The [Use Relative
References] button is a - OR -
toggle button, therefore
› Select the View Tab.
selecting it turns it on and
off. › In the Macros Group, click the [Macros] button.
› Choose Use Relative References.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 9


Lesson 1: Macros and VBA

Recording a Once you have planned your Macro, recording a Macro is very
easy using the steps outlined below, even if you don't have access
Macro to the Developer Tab.

Creating a Macro Using the View Tab

› Select the worksheet where you want to begin


You can also recording.
access the Record › If you want to use Relative Referencing, select the
Macro dialog box View Tab, locate the Macros Group, click the [Macros]
by clicking the
button, and choose Use Relative References. Make sure
[Record Macro]
button located
the icon is highlighted.
on left side of the › To record, select the View Tab. Locate the Macros
Status Bar. Group. Click the [Macros] button and then select
Record Macro.

› The Record Macro dialog box is displayed. Choose the


following:

If you want your › In the Macro name: field, type a descriptive name -
Macro to run
remember, no spaces.
automatically when
the file is opened, use › If you want to assign a shortcut key, type a letter or
the name Auto_Open. number that is not used for other shortcuts in the
text box to the right of Ctrl+.
› In the Store macro in: drop-down list, select one of
the options This Workbook, Personal Macro Book, or
New Workbook.

A Macro that is stored in the Personal Macro


Workbook can be run in any Excel workbook on the
same computer. Therefore, use this option if you
are creating a Macro that you think you would like
to use in multiple workbooks.
› If desired, type in a description in the Description:
field. This will show up in the dialog box when you
view your Macro and is very useful if others are
going to be using your Macros.

Page 10 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA

Recording a › Click [OK] to begin recording. Notice the [Record


Macro] button in the status bar changed to a [Stop
Macro, Recording].
continued

Record Macro Stop Recording Macro


› Perform the tasks you want recorded. Be careful
where you click and what you type. Excel will
record each step. If you make a mistake, correct and
keep going - you can edit the Macro once you are
finished.
› Click the [Stop Recording] button on the Status
Bar or select it from the [Macros] button drop-
down on the View Tab.
› Click on the File Tab. Choose Save-As and save your
workbook as an Excel Macro-Enabled Workbook
(*.xlsm) file from the Save as type: field drop-down
list.
› Warning: If you record a Macro in a regular workbook
and then try to save it without changing the Save as
Type: field, you will see an alert like the one below.
If you click the [Yes] button, the Macros created and
stored in this workbook will not be saved.

Creating a Macro Using the Developer Tab

› Select the worksheet where you want to begin


recording.
› If you want to use Relative Referencing, select the
Developer Tab, locate the Code Group, click the [Use
Relative References] button. Make sure the button is
highlighted.
› To record, click the [Record Macro] button.
› The Record Macro dialog box is displayed. Follow the
same steps as outlined in the previous section.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 11


Action 1.2- Recording an Absolute Macro in File

Instructions: Results/ Comments:


1. Create new workbook, on the Developer The button is located in the Code Group, it
Tab check to make sure the [Use Relative should not be highlighted. This will be an
References] button is NOT active. Absolute Reference Macro.

2. Click the [Record Macro] button. The Record Macro dialog opens.

3. In the Macro Name: field, type in; This will be the name of the macro.
NewInvoiceLayout.

4. In the Shortcut key: field, type in; This will be the keyboard shortcut to run
< Q > while holding the [Shift] key. the macro.

5. From the Store macro in: field drop- By choosing this option, this macro will
down, choose; This Workbook. only be available when working in this
specific file.

6. In the Description: field type in; The description should be clear and
< This adds logo with address block and concise.
inserts data structure with formulas. >

7. Click the [OK] button.


You are now recording, everything you do
now is captured in the new macro.
8. Click the Insert Tab, in the Illustrations
Group click the [Pictures] button. The Insert Picture dialog opens.

9. Choose the Logo.jpg file from the lessons


folder and click the Insert button. The image is inserted to the worksheet but
may need to be repositioned and sized.
10. Move the image to the upper left corner
of the worksheet. Drag the image to the location and use the
corner handle to resize it.
11. Select cell B8 and type in;
< Jan > A list of the first six months is added to the
then use Autofill across to G8. worksheet.

12. Select cell H8 and type in;
< Total > This will be the column where each region
will be summed.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA, Page 12
Action 1.2- Record an Absolute Macro in File, continued

Instructions: Results/ Comments:


13. Select cell H4 and type in; This shows where a tax rate can be added
< Tax Rate > . later.

14. Select cell H5 and apply a fill color.

15. Select cell A9 and type in; This is the list of regions.
< Region1 >
then use Autofill down to cell A14.

16. Select cell H9 and type in the following This formula adds up each month for the
formula; region.
=SUM(B9:G9). Tap the [Enter] key.

17. Use Autofill down to cell H14. Each region will be calculated as values
are added.

18. Select cell G15 and type in;


< Subtotal > .

19. Select cell H15 and type in the following The subtotal of all the regions is calculated
formula; here.
=SUM(H9:H14). Tap the [Enter] key.

20. Select cell G16 and type in;


< Tax > .

21. Select cell H16 and type in the following The amount of taxes owed is calculated
formula; here.
=H15*H5. Tap the [Enter] key.

22. Select cell G17 and type in;


< Grand Total > .

23. Select cell H17 and type in the following The final total is calculated here.
formula;
=H15+H16. Tap the [Enter] key.

24. Select cell B9. This will be where you begin entering data
into the worksheet.

25. Click the Stop Recording button in the The recording is stopped and the macro is
Macros Group on the Developer Tab. ready for use.
Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros
Lesson 1: Macros and VBA, Page 13
Lesson 1: Macros and VBA

Running a Once your Macro is created and saved, it will be available to run
anytime it is needed.
Macro
Run a Macro Using the Macro Dialog Box

You can also › Select the worksheet where you want to apply the
access the dialog Macro.
box by going › Select the Developer Tab
to the View Tab and
selecting View Macros › Click the [Macros] button.
from the [Macros] drop
down button. › The Macro dialog box is displayed.

› Select which Macros you want to display by clicking


on the down-arrow of the Macros in: field.
› If All Open Workbooks is in the Macros in: drop-
down, you can see the Macros from any open
workbook as well as from the personal Macro
workbook.
› From the list of Macros, select the one you want to
apply.
› Click [Run] or double-click the name. The Macro dialog
box will disappear, and the sequence of instructions
that was recorded will be performed on the current
workbook.

Page 14 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Action 1.3- Run Macro in File

Instructions: Results/ Comments:


1. Click the [New Sheet] button.

2. Click the Developer Tab, in the Code The Macro dialog opens, this window
Group, click the [Macros] button. allows you to see, run, or edit.

3. Select the macro and click the [Run] The sheet now has the logo, structure and
button. formulas in place.

4. Click the [New Sheet] button. Another sheet is added to the workbook.

5. Use the keyboard shortcut assigned to The sheet now has the logo, structure and
the macro; formulas in place.
[Ctrl+Shift+Q].

6. Save the file as MyMacro.XLSM. [F12] will open the Save As dialog. Save it
Remember to choose the Excel Macro- in the Lessons folder as an Excel Macro
Enabled Workbook from the Save As Type: Enabled Workbook.
drop-down.

7. Open a new file. [Ctrl+N].

8. Click the Developer Tab, in the Code The Macros dialog opens, you can see and
Group, click the [Macros] button. use the Macro you just created. This is
because the system is searching All Open
Workbooks as the default within the Macros
in:.

9. Close both files without saving any [Ctrl+W] for both files.
changes.

10. Open a new blank document. [Ctrl+N].

11. Click the Developer Tab, in the Code The Macros dialog opens, it has no macros
Group, click the [Macros] button. listed since the macro was recorded and
stored in This Workbook. Once the original
file has been closed, it's macros are not
available in new files.

12. Close the Macro window and close the [Ctrl+W].


file without saving.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA, Page 15
Lesson 1: Macros and VBA

Editing a Macro There are several reasons to edit a Macro instead of rerecording:

› To correct mistakes made while recording


› To change recorded code
› To add complex tasks that cannot be recorded
such as those involving user input or mathematical
calculations.

Visual Basic for Applications


Macros use a programming language called Visual Basic for
Applications (VBA). As mentioned earlier in this chapter, when
For additional recording a Macro, Excel writes the VBA code for the keystrokes
instruction on
using VBA, and commands you use.
try the Excel VBA
Programming course Writing program code can be tricky even for seasoned
at The Computer programmers. If you don’t catch on right away, don’t be
Workshop. alarmed. Be patient, keep an open mind, and try to have fun
exploring what you can do with VBA and Excel.

VBA Modules
Each Macro consists of a block of VBA code. A Module is used
to store these Macros. Modules can contain one or more Macros.
Workbooks and templates can contain one or more Modules. A
set of Modules in a workbook is called a Project.

Visual Basic Editor


The Visual Basic Editor is one of many add-in applications
available in Excel. It is used to load, view, and edit the VBA code
in a Macro. It has its own interface, menu bar, and help system.

Page 16 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA

Editing a Opening the Editor from Within Excel


› Click the View Tab in the Macros Group, click the
Macro, [View Macros] button.
continued
- OR -
› Click the Developer Tab and in the Code Group, click
on the [Macros] button.
› Select a Macro that you want to work with from the
Macro dialog box.
To toggle
between the › Click [Edit]. The Visual Basic Editor opens in its own
Visual Basic window.
Editor and your
spreadsheet, press › In the Code window, make the necessary changes.
[Alt + F11].
If you want to test the code first, type it in the Immediate Window
and press [Enter] to run the code. If the Immediate Window is
not showing, click View on the Menu Bar and select Immediate
Window, or press [Ctrl+G].
› Close the Visual Basic window to return to Excel.
› Run the Macro to test its functionality.
› Save your file.

Following is a description of the main components of the Visual


Basic Editor. If your Editor doesn't display all of them, use the
View menu to show them.

Menu Bar

Project Explorer
Code (Editing)
Pane
Window

Properties
Window
Immediate
Window

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 17


Lesson 1: Macros and VBA

Editing a Component Description


Macro, Menu Bar Contains menus for saving files, editing
continued code, formatting, debugging code,
running Macros, inserting objects, etc..
Tool Bar Contains buttons for several menu
items. At the far right is a field
containing the line and column number
of the insertion point in the Visual Basic
editing window.
You can open
several Code Project Explorer A listing of VBA modules in all open
windows at the Panel workbooks and templates. Double-click
same time for different If you cannot see the on a Code Module to open it in the Code
modules giving you Project Explorer panel, (Editing) window. Expand and collapse
great flexibility when click the [Project
modifying code. You Explorer] button on the the view of the contents with the (+) and
can see, type, copy and toolbar. (-) buttons.
paste code from one
Properties Window List of properties (characteristics) of the
window to another.
selected item in the Project Explorer.
Code (Editing) Displays the VBA code that was
Window recorded and/or written for the selected
project. This is where you read, enter,
and directly modify the VB code.
Immediate Window Allows you to type or paste a line of
code and press [Enter] to run it. You
can then copy and paste into the Code
window.

Page 18 Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Action 1.4 - Edit a Macro

Instructions: Results/ Comments:


1. Open the MyMacro.XLSM workbook. This file should be in the Lesson Folder.
If the Security Warning bar appears, click
the [Enable Content] button.

2. Click the Developer Tab, in the Code The Macros dialog opens.
Group, click the [Macros] button.

3. Select the macro and click the [Edit] The VBA Editor opens.
button.

4. In the Project panel, open the Models If the Project Panel is not visible, go the
folder and double click the Module1 View option in the main menu and click
icon. If necessary. the Project Panel to activate the panel.
When you double click the Module1 icon
the code is displayed in the main panel to
the right.

5. Set the cursor at the end to the line that You will be adding some code to make the
says: headings bold.
ActiveCell.FormulaR1C1 = "Total"

6. Tap the Enter key and type in; This code will select the headings range
< Range("B8:H8").Select and apply a bold format to the text. Tap
Selection.Font.Bold = True > the [Enter] key before typing the second
line of code.

7. Click the [Save] icon in the toolbar and The macro is updated and you are taken
then the [Excel] icon. back into your Excel file.

8. Examine the headings on your sheet. Nothing has been changed, the macro
must be re-run in order for the change to
take affect.

9. Add a new sheet to the workbook. Click the [New Worksheet] button.

10. Click the Developer Tab, in the Code You can also use the keyboard shortcut
Group, click the [Macros] button. Select you assigned to the macro to re-run it.
the macro and click the [Run] button.

11. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros


Lesson 1: Macros and VBA, Page 19
Lesson 1: Macros and VBA

Recording Personal Macro Workbooks


a Macro in In the previous exercises you were recording the macro in the
current file being worked on, this is a good standard practice
the Personal since most of the time the macro will be relative to that file. The
Workbook Personal Macro Workbook is where you can consider storing
a macro or set of macros that are run often in new files. When
you record to the Personal Macro Workbook, a hidden sheet is
added to the Excel normal .xlst template. What this means is that
any new workbook you create can access the macro and run it,
making repetitive tasks much more manageable.

When creating new files and running the personal macro, the file
can be saved as either a normal .xlsx or .xlsm file type. Choosing
the Excel Workbook(.XLSX0) file format will disable the macro
for future use in the file being saved. While saving the file as
an Excel Macro Enabled Workbook(.XLSM) will maintain the
functionality of the macro for future use in the file.

Saving a Macro in the Personal Macro Workbook

Recording a macro in the Personal Macro Workbook is done in


the same manner as before except that you will choose Personal
Macro Workbook in the Store macro in: field.

Page 20 Excel 2019: Level 3, Rel. 1.0, I


Action 1.5 - Record Macro in Personal Macro Workbook

Instructions: Results/ Comments:


1. Create a new workbook, on the The button is located in the Macros Group,
Developer Tab check to make sure the it should not be highlighted.
[Use Relative References] button is NOT
active.

2. Click the [Record Macro] button in the The Record Macro dialog opens.
Code Group.

3. In the Macro Name: field type in; This will be the name of the macro.
< NewSheetLayout >.

4. Leave the Shortcut key: field blank. There will be no need for a keyboard
shortcut for this macro but you can assign
one if you like.

5. From the Store macro in: field drop- By choosing this option, this macro will be
down choose Personal Macro Workbook. available in any new or existing file.

6. In the Description: field type in; The description should be clear and
< This Adds Logo with address block concise.
and inserts data structure with formulas
>.

7. Click the [OK] button. You are now recording, everything you do
now is captured in the new macro.

8. Click the Insert Tab, in the Illustrations


Group click the [Pictures] button.

9. Choose the Logo.jpg file from the lessons


folder and click the [Insert] button.

10. Move the image to the upper left corner


of the worksheet.

11. Select cell B8 and type in; A list of the first six months is added to the
< Jan > worksheet.
then use Autofill across to G8.

12. Select cell H8 and type in; This will be the column where each region
< Total > . will be summed.

Excel 2019: Level 3, Rel. 1.0, I


Lesson 1: Macros and VBA, Page 21
Action 1.5 - Record Macro in Personal Macro Workbook, continued

Instructions: Results/ Comments:


13. Select cell G1 and type in; This shows where a tax rate can be added
< Tax Rate > . later.

14. Select cell H1 and apply a fill color. This is the list of regions.

15. Select cell A9 and type in; This formula adds up each month for the
< Region1 > then use Autofill down the region.
cell A15.

16. Select cell H9 and type in the following Each region will be calculated as values
formula; are added.
=SUM(B9:G9). Tap the [Enter] key.

17. Use Autofill down to cell H15.

18. Select cell G16 and type in; The subtotal of all the regions is calculated
< Subtotal >. here.

19. Select cell H16 and type in the following


formula;
=SUM(H9:H15). Tap the [Enter] key.

20. Select cell G17 and type in; The amount of taxes owed is calculated
< Tax >. here.

21. Select cell H17 and type in the following


formula;
=H16*H1. Tap the [Enter] key.

22. Select cell G18 and type in; The final total is calculated here.
< Total >.

23. Select cell H18 and type in the following


formula; This will be where you begin entering data
=SUM(H16:H17). Tap the [Enter] key. into the worksheet.

24. Select cell B9.

Excel 2019: Level 3, Rel. 1.0, I


Lesson 1: Macros and VBA, Page 22
Action 1.5 - Record Macro in Personal Macro Workbook, continued

Instructions: Results/ Comments:


25. Click the Developer Tab, in the Macros The recording is stopped and the macro is
Group, click the [Stop Recording] ready for use.
button.

26. Save the file. F12, do not change anything.

27. Close the file. [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, I


Lesson 1: Macros and VBA, Page 23
Lesson 1: Macros and VBA

Running a Using a Personal Macro


Personal Macro Once the macro has been stored in the Personal Macro Workbook
and recorded it can be used in any new files you create. It must
Workbook be noted that personal macros are only available on the computer
Macro where they were recorded.

To access the Macro

› Use the [Macros] button in the Code Group on the


Developer Tab.

- OR -
› Use the [Macros] drop-down on the View Tab.

› The Macro dialog opens, you should be able to see


your personal macros listed.

Page 24 Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA

Editing Personal Accessing the Personal Macro Workbook


In order to access the macros stored in the Personal Macro
Macros Workbook is done by unhiding the personal macro worksheet,
now stored in the blank workbook template.

› Click the View Tab.


› In the Windows Group click the [Unhide] button.
The [Unhide]
(This button will only be active in a new file if you have
button is only
active when stored macros in the Personal Macro Workbook.)
there are macros
stored in the Personal
Macro Workbook.

› The Unhide dialog opens.

› The PERSONAL.XLSB is shown.


› Click the [OK] button.
› The PERSONAL.XLSX sheet opens in a new Excel
window.

Editing the Personal Macro


› Click the Developer Tab.
› Click the [Macros] button in the Code Group.
› Select the Macro and click the [Edit] button.
› The VBA Editor opens to the macro.

Excel 2019: Level 3, Rel. 1.0, Editing Personal Macros Page 25


Action 1.6 - Running and Editing a Personal Macro

Instructions: Results/ Comments:


1. Create a new blank file. CTRL N.

2. Click the Developer Tab, in the Code The Macro dialog opens.
Group, click the [Macros] button.

3. Choose the This should be the only macro in the list.


PERSONAL.XLSB!NewSheetLayout macro Once the macro has been run the sheet
and click the [Run] button. now has the structure and formulas in
place.

4. Click the [New Sheet] button. A new sheet is added to the workbook.

5. Click the View Tab, click the [Macros]


button drop-down and choose View
Macros.

6. Choose the
PERSONAL.XLSB!NewSheetLayout macro
and click the [Run] button.

7. Click the Developer Tab, in the Code The Macro dialog opens.
Group, click the [Macro] button.

8. Select the The sheet now has the structure and


PERSONAL.XLSB!NewSheetLayout formulas in place. The Macro dialog opens.
and click the [Edit] button.

9. Click the View Tab, in the Window A warning dialog box opens to let you
Group, click the [Unhide] button. know that the personal workbook must be
unhidden before editing can be done.

10. Select the PERSONAL.XLSB workbook The Unhide dialog opens. By default a
and click the [OK] button. hidden workbook is opened in Excel
as long as any Macros are saved in the
Personal Macro Workbook.

11. Click the Developer Tab, in the Macros The Macro dialog opens.
Group, click the [Macro] button.

12. Select the NewSheetLayout and click the The VBA Editor opens without issue this
[Edit] button. time.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 26
Action 1.6 - Running and Editing a Personal Macro, continued

Instructions: Results/ Comments:


13. Set the cursor at the end of the line that You will edit the code to make the
says: headings bold again.
ActiveCell.FormulaR1C1 = "Total"

14. Tap the ]Enter] key and type in; Remember to tap the [Enter] key before
< Range("B8:H8").Select typing the second line of code.
Selection.Font.Bold = True >.

15. Click the [Save] icon in the toolbar and The macro is updated and you are back in
then the [Excel] icon. your Excel workbook.

16. Click the View Tab in the Window The PERSONAL.XLSB sheet is hidden.
Group and click the [Hide] button.

17. Create a new sheet. Click the [New Sheet] button.

18. Click the Developer Tab, in the Macros The Macro dialog opens.
Group click the Macro button.

19. Select the The new sheet has its content and
PERSONAL.XLSB!NewSheetLayout formulas added, with the formatting
and click the Run button. change applied.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 27
Lesson 1: Macros and VBA

Adding a Macro To make running a Macro easier, you can add a button to
the Quick Access Toolbar for convenience. If the workbook
Button to the containing the Macro is not open, the button will simply be
QAT grayed out. If you add the Macro to the Personal workbook
when you create it, the Macro will always be available regardless
of which workbook you have open.

To Add a Macro Button to the QAT


› Click on the [More] button at the end of the QAT.
› Select More Commands... from the drop-down list.
› Click on the drop-down arrow in the Choose
commands from: list box.
› Select Macros.
› In the list on the left, choose the Macro for which you
would like to add the button.
› Click the [Add] button to add it to the list on the right.

- OR -
› Double-click on the Macro to add it to the list on the
right.

Page 28 Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA

Adding a Macro To Change the Appearance of the Button


Button to the You may want to change the button icon and the associated text
so that your new [Macro] button can be distinguished from the
QAT, other buttons in your QAT.
continued
› Select the Macro from the list on the right of the Excel
Options dialog box.

› Click on the [Modify] button at the bottom of the


dialog box.
› Choose a different symbol to represent your Macro.

› Type a descriptive name in the Display name: field.


› Click [OK].
You should now see the new button on the QAT.

Excel 2019: Level 3, Rel. 1.0, Page 29


Action 1.7 - Adding the macro to the QAT

Instructions: Results/ Comments:


1. Click the drop-down arrow on the QAT The Options dialog opens to the Customize
and choose More Commands. QAT category.

2. From the Choose Commands From: The left side panel displays any macros
drop-down choose Macros. associated with this or personal
workbooks.

3. Double click the Double clicking the macro adds it to the


PERSONAL>XLSB!NewSheetLayout. QAT list of commands in the right panel.

4. Select the macro from the list of


commands on the QAT on the right side.

5. Click the [Modify] button below the The Modify Button dialog opens.
right side panel.

6. Choose an Icon and click the [OK] The icon is now used to represent the
button. macro.

7. Click the [OK] button. The Options dialog closes and the new
button is visible on the QAT.

8. Click the [New Sheet] button, then click The sheet now has the logo, structure and
the new button you just added to the formulas in place.
QAT.

9. Close your file without saving. [Ctrl+W].

10. Create a new blank workbook. [Ctrl+N].

11. Click the macro button on the QAT. The sheet now has the logo, structure and
formulas in place.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 30
Lesson 1: Macros and VBA

Recording Relative Reference Macros


a Relative All of the macros recorded up to this point have used absolute
cell addressing. When looking at the VBA code generated while
Reference Macro recording the macro, notice that the active cell is referred to
by Row#Column# (ActiveCell.FormulaR1C1) and the selected
cell or range lines of code refer to specific cells or ranges
(Range("B2:H2").Select). Allowing the macro to be run from any
location and apply changes or additions in those specified cells in
the Range(##).Select lines.

When recording a macro using Relative Cell Addressing, the cell


addresses are replaced with offset parameters. The active cell
location defines whatever cell is active at the time of recording
and running of the macro. The code looks like this:
ActiveCell.Offset(1, -1)

Move this many rows then columns


from whatever the starting position

The first number represents the Rows while the second number
represents the Columns. Positive values move down in Rows
and right in Columns, negative values move the rows up and
Columns left.

Turning on Use Relative References


This can be done from either the [Macros] drop-down on the
View Tab or the [Use Relative References] button in the Code
Group on the Developer Tab.

When this option is enabled it will be highlighted to show it is


active. You then record the macro as before. It is a good idea
to have the A1 as the active cell before beginning to record the
macro. With offsets in play it is possible to have the macro trying
to move above row 1 or left of column A, both of which will
cause debugging errors if the macro tries to select cells outside
the normal sheet.

Excel 2019: Level 3, Rel. 1.0, Page 31


Action 1.8 - Relative Reference macro

Instructions: Results/ Comments:


1. Add a new worksheet. If necessary, create a new workbook.

2. Select cell A1.

3. Click the Developer Tab, in the By making this button active, you are able
Macros Group, click the [Use Relative to run the macro based on offsets from
References] button. whatever cell is active.

4. Click the [Record Macro] button. The New Macro dialog opens.

5. In the Macro Name: field type;


NewDataBlock.

6. In the Shortcut key: field enter;


SHIFT W.

7. From the Store macro in: field drop-


down choose; This Workbook.

8. In the Description: field type in;


< This adds a new data block with
formulas >.

9. Click the [OK] button. The macro is now being recorded.

10. Select cell A4 and type in; This is the beginning of a list.
< Jan >.

11. Use Autofill down to cell A15. The list is populated.

12. Format the text to be Bold. [Ctrl+B].

13. Select cell B3 and type in; This is the beginning of another list.
< Week 1 >.

14. Use Autofill over to cell F3. A numeric list of weeks is created.

15. Select cell G3 and type in;


< Total >.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 32
Action 1.8 -Relative Reference macro, continued

Instructions: Results/ Comments:


16. Select cell G4 and type in the following Each of the weeks in Jan are being totaled.
formula;
=SUM(B4:F4).

17. Use Autofill down to cell G15. All the months of the year will now be
calculated.

18. Select cell B4. This will be an active cell when the macro
has been run.

19. Click the Developer Tab, in the Macros The macro is completed and ready to be
Group, click the [Stop Recording] run.
button.
This is where the next data block needs to
20. Select cell A20. be added.

21. Run the NewDataBlock macro. Use the keyboard shortcut you assigned to
the macro, [Ctrl+Shift+W].

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 33
Lesson 1: Macros and VBA

Removing A Removing a Personal Macro Workbook Macro


Personal Macro When the macro stored in the Personal Macro Workbook is no
longer necessary, you may want to delete it from the Personal
Macro Workbook. You begin by accessing the Personal Macro
Workbook by clicking the [Unhide] button in the Window
Group on the View Tab. (Refer back to page 23 for instructions
on accessing the Personal Macro Workbook.)

› Open a new blank file. [Ctrl+N]


› Activate the View Tab.
› In the Window Group, click the [Unhide] button to
open the Unhide dialog.

› Choose the PERSONAL.XLSB file and click the [OK]


button.
› The PERSONAL.XLSB file opens.

› It appears as a blank worksheet, look at the Title


Bar to see that you are working in the
PERSONAL.XLSB file.
› Activate the Developer Tab.
› In the Code Group, click the [Macros] button.

Page 34 Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA

› Choose the PERSONAL.XLSB from the Macros in:


field drop-down menu.

› Select the unwanted macro and tap the [Delete] button.

› The Do you want to delete macro (Macro Name) dialog


appears, click the [Yes] button to remove the selected
macro from the PERSONAL.XLSB.
If you simply save and close at this point the PERSONAL.XLSB
will open every time you try to create a new workbook. This can
quickly get out of hand as you try making more modifications
and saving more variations, Excel will end up open several
unwanted files each time the program is launched or a new file
created. Be sure to follow the next steps to avoid these problems.

Excel 2019: Level 3, Rel. 1.0, Page 35


Lesson 1: Macros and VBA

Resetting the Default Workbook


After deleting the unwanted macros from the PERSONAL.XLSB
workbook, there are a few more steps to be taken to reset the
default workbook.

› Activate the View Tab


› Click the [Hide] button.
› The PERSONAL.XLSB is no longer active or
displayed in the program titlebar.
› There may be no worksheet in view.
› Close Excel.
› When the Want to save your changes to 'PERSONAL.
XLSB'? dialog appears, click the [Save] button.

› Saving the changes will keep the PERSONAL.


XLSB workbook hidden in the future.
› Restart Excel and create a new workbook if necessary.

If the PERSONAL.XLSB reopens, repeat the steps to reset the


default workbook.

Page 36 Excel 2019: Level 3, Rel. 1.0,


Action 1.9 - Removing a Macro from the Personal Workbook

Instructions: Results/ Comments:


1. Close any open files without saving. [Ctrl+W].

2. Create a new blank workbook. [Ctrl+N].

3. Click the View Tab, in the Window The Unhide dialog opens.
Group click the [Unhide] button.

4. Select the PERSONAL.XLSB workbook The PERSONAL.XLSB workbook opens.


and click the [OK] button. Check the title in the titlebar to ensure that
the correct workbook is active.

5. Click the Developer Tab, in the Code The Macros dialog opens. You could also
Group click the [Macros] button. access the [Macros] button on the View
Tab in the Macro Group.

6. In the Macros in: field drop-down, This is to make sure that you are removing
choose the PERSONAL.XLSB file. the macro from the PERSONAL.XLSB
workbook and not any other.

7. Select the NewSheetLayout macro in the All macros in the PERSONAL.XLSB are
Macro Name: field. displayed in the Macro Name: field.

8. Click the [Delete] button. To delete the specified macro.

9. When the Warning dialog opens click the The macro is removed from the personal
[Yes] button. workbook.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 37
Action 1.9 - Resetting the Default Workbook

Instructions: Results/ Comments:


1. Activate the View Tab. You will be closing the personal workbook
next.

2. Click the [Hide] button in the Window The PERSONAL.XLSB closes. You may or
Group. may not see another workbook in Excel.

3. Close Excel. Click the [Close] button or use the [Alt+F4]


shortcut. Since you have made changes to
the PERSONAL.XLSB file a Save prompt
appears.

4. Click the [Save] button to commit the This includes the removal of the unwanted
edits just made to the PERSONAL.XLSB macro and set the view status of the
file. PERSONAL.XLSB to a hidden state.
Excel closes.

5. Restart Excel and open a new blank Click the [Blank Workbook] button on the
workbook. Start Screen if necessary. You should see
the new workbook title be Book1 in the
program titlebar.

Excel 2019: Level 3, Rel. 1.0,


Lesson 1: Macros and VBA, Page 38
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Lesson 2: Form Controls

Lesson Overview

You will cover the following concepts in this


chapter:
› Form Controls
› Adding Form Controls
› Modifying Form Controls
› Adding a Combo Box
› Adding A Group Box
› Adding An Option Button
› Adding A Button
› Assigning a Macro to a Form Control
Lesson Notes
Lesson 2: Form Controls

Form Controls Another way to add functionality to your workbooks is to


use Excel’s Form Controls. By using Form Controls, you can
provide a user friendly way to make choices and selections on
a worksheet. You can arrange Form Controls to allow users to
perform calculations and get results without having to interact
directly with the source data. You can assign a Macro to a
Form Control, and you can even use Form Controls to create a
customized user interface for a workbook.

To create Form Controls, you must have the Developer Tab


displayed on the ribbon. See Lesson 1 if you do not remember
how to display the Developer Tab.

When using Form Controls, you can place data lists, lookup
tables, functions and formulas on a separate worksheet from the
actual controls. This way, the user can access one sheet with all
the controls they need, and the sheets with the actual data and
formulas can be set up on a protected sheet to prevent deletion or
modification.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 41


Lesson 2: Form Controls

Form Controls, What is a Form Control?


continued A Form Control is an interactive component that can be added to
a worksheet. You can add a single Form Control to a worksheet,
or a group of Form Controls. You can also combine Form
Controls to create a simple user interface for the user to interact
within a workbook.

Some of the Form Controls that you can choose from include:

› Check boxes
› Combo boxes
› Control buttons
› List boxes
› Option (radio) buttons
› Scroll bars

You can use Form Controls to design a workbook that encourages


users to make certain choices and selections. Operations can then
be performed based on the selections made. Form Controls can
also be used to provide data options or choices for the user.

This allows you to manage what kind of data a user can enter or
manipulate and what happens in the worksheet after a user has
performed specific actions.

You can also use Active X form controls which offer a much
more extensive properties that you can use to customize their
appearance, behavior, fonts, and other characteristics. The draw
back with these type of form controls is that the user of the file
will require having Active X on the systems which means these
form controls can be less accessible to people running older
versions of Excel. In this book we will be focusing on the regular
form controls.

Page 42 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Form Controls, Form Controls in a worksheet make it easier for people to enter
continued or edit data. A worksheet form contains controls, such as boxes or
drop-down lists that can be used to make selections that trigger
simple calculations, or to provide a basic interface that allows a
user to interact with the workbook data.

When using Form Controls in your workbook, keep in mind that


one type of Form Control may be better suited for a task than
another.

The following is a list of the main Form Controls available in


Excel.

The Label Control allows you to add a text label to a


worksheet.
The Button Control allows you to add a button to a
worksheet. (The button could be assigned to a Macro if
you wish.)
The Check Box Control allows a user to make
selections based on true or false values.
The Option Button Control can enable a single
selection from mutually exclusive items in a set.
The List Box Control can display a list of values or
choices. It is usually sized so that several rows are
visible at all times. If there are more rows than can be
displayed, a scroll bar appears. The user is limited to
the existing values and cannot type a value into a list
box.
The Combo Box Control can also display a list of
choices. This list is hidden until you click the drop-
down arrow. The user can type a value that is not in
the list.
The Scroll Bar Control allows you to scroll through a
selection of data.
The Spin Button Control allows you to increase or
decrease a numeric value for input.
The Group Box button allows you to create a group
box or a frame control to visually organize related
items on a form.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 43


Lesson 2: Form Controls

Adding Form Adding a Form Control to a Worksheet


Controls In Excel, it is fairly easy to add a Form Control to a worksheet.

› Make the Developer Tab active, if it is not visible use


the methods described in the previous lesson to add it
to the ribbon.
In order to › In the Form Controls Group, you will see a panel of
access the Form control icons like the ones described on the previous
Controls, the
Developer Tab needs page. Mouse-over the buttons to see the screen tip that
to be active. explains what they do.
› Select the [Insert] button drop-down to expand the list
of From Controls.

› Click on the icon for the desired control. Your mouse


pointer will turn into a crosshair as you move the
mouse over the grid area of the worksheet.
› To create the control, click and drag the mouse pointer
to draw the control on the worksheet.

› Each control will have properties that affect the


behavior of the control. This course goes over a few of
the controls available in Excel.
The process described here is basically the same for any of the
Form Controls. The only differences are the control property
modifications, and data source and link options which vary from
control to control.

Page 44 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 2.1 - Adding a control

Instructions: Results/ Comments:


1. Open a blank workbook. [Ctrl+N].

2. Activate the Developer Tab. If the Developer Tab is not displayed on


the ribbon, go to the Excel options, click
the Customize Ribbon category on the left
side of the Options dialog and then check
the Developer Tab option in the right list
of ribbon tabs.

3. Click the [Insert] button drop-down in The list of Form Controls are displayed.
the Form Controls Group.

4. Click the List Box control from the list of It is the second option in the first row of
available controls. options.

5. Set the cursor over cell B6 The cursor is a crosshair,which indicates


click and drag over to cell C10 and let go you are ready to draw out the chosen form
of the mouse button. control. When you let go of the mouse the
control is added to the worksheet.

6. Click into any cell to deselect the control. The resizing handles disappear.

7. Right-click the control to re-select it. This is the method to reselect a form
control for editing or repositioning.

8. Examine the list of option in the Depending on the control different options
contextual menu. are available.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 45
Lesson 2: Form Controls

Modifying Form Modifying the Control


› Right-click the control to reselect it and display a
Controls contextual menu related to the control.
› When the resizing handles are displayed you can
manually resize the control. To move the control, hover
over it until the four sided arrow is displayed, then
click and drag it into position.
› To access the Form Control dialog box, right-click the
control and choose Format Control from the menu. The
Format Control dialog box will be displayed.

› The Format Control dialog offers several tabs to control


the appearance and functionality of the form control.
› On the Size Tab, you will find options to modify the
size of the control.

Page 46 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Modifying Form › On the Protection Tab, you can choose to lock


or unlock the control (used with protected
Controls, worksheets).
continued

› On the Properties Tab, you can modify how the


Control is positioned when cells are moved or
resized. You can also specify whether or not you
want the control to be printed with the worksheet.

› The Alt Text Tab has options for displaying


alternative text for the control.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 47


Lesson 2: Form Controls

Modifying Form › On the Control Tab, you will find options specific
to the type of control you have selected.
Controls,
continued

› For a List Box or Combo Box Control, you


may find options for specifying the input
range, (a specific cell range containing the
data that will appear in the list), and the cell
link, which is the cell that will receive an index
value corresponding to the item chosen from
the list. When you make a selection from a list
box, Excel will place the index value into the
specified cell link.
› For a Checkbox or Option Button Control, you
may find options for the default selection, as
well as the cell link and an option to apply 3-D
effects to the box itself.
› For a Scroll Bar or Spin Box Control, you will
find options to set the default value, as well as
the range of options and in what increments
those options show. You can also specify the
cell the data is linked to and whether or not the
Scroll Bar or Spin Box Control should have a
3-D effect applied.

List Options Combo Options

Page 48 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Modifying Form › The Formatting Control dialog offers other tabs


allowing you to format the text and appearance of
Controls, the button control.
continued

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 49


Action 2.2 - Examining the Format Controls Dialog

Instructions: Results/ Comments:


1. Click into cell H1 and type in; You are setting up the input range for the
< Monday >. form control.

2. Use the Autofill handle to add the rest of The rest of the weekdays are added to the
the weekdays down to cell H7. worksheet.

3. Right-click the control you just added The Format Control dialog opens.
before and choose Format Control from
the contextual menu.

4. Click the Size Tab in the dialog. The size controls are now displayed in the
dialog.

5. Set the Height to 2.5" The size of the control is now set.
Set the Width to 2"

6. Click the Protection Tab to see that the This tab offers the same type of object or
control is locked. cell protection as the Protection Tab in the
Format Cells dialog.

7. Click the Properties Tab. Examine the options of how the control
will react when changes are made in the
worksheet.

8. Uncheck the Print object checkbox. Now the control will not be included when
the worksheet is printed.

9. Click the Alt Text Tab, click in the This tab allows you to enter text which
Alternative Text field and type in; will be read aloud for the visually
< Click here to choose the day from the impaired, this is part of ensuring that your
list. >. document is ADA compliant. (ADA =
American Disabilities Act)

10. Click the Control Tab. From this tab you can add functionality to
the control.

11. Click into the Input range field, then Here, you are connecting the cells that
highlight cells H1:H7. contain the values to be displayed in the
drop-down.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 50
Action 2.2 - Examining the Format Controls Dialog, continued

Instructions: Results/ Comments:


12. Click into the Cell Link field and click Here you are setting the location where the
cell A6. choice from the list will be displayed in the
workbook.

13. Click the [OK] button. The Format Control dialog is closed and all
setting applied.

14. Deselect the control. Click any cell on the worksheet.

15. Click the day to select from the list. Use the Left mouse button to interact with
the control. The list of weekdays has been
added to the form control and when one is
chosen the numeric position of the choice
is displayed in cell A6.

16. Close the file without saving. [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 51
Lesson 2: Form Controls

Adding a Combo The Combo Box Control


Box A Combo Box control combines a text box with a list box to create
a drop-down list. Unlike a list box, the user is required to click
the down arrow to display the list of items.

The Combo Box can use a range of existing cells to populate the
drop-down list as well as return a value into another cell based
on the choice made. The returned value is simply the numeric
position of the choice within the list.

This is a very useful control when the returned value is used in a


Vlookup, Hlookup, Match, Index, or even an If formula.

Adding the control


› Click the Developer Tab to activate it.
It is easiest to
add the list of › Click the [Insert] button in the Controls Group and
choices into a
choose the Combo Box control.
cell range somewhere
within the current
workbook before
adding the control.

› Draw out the control where you want on the


worksheet.
› Add functionality to the control by right-clicking it and
choosing Format Control from the contextual menu.

Page 52 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Adding a Combo › In the Format Control dialog, activate the Control tab.

Box, › In the Input range: field, select the cells containing


continued the values to be used in the list.

› In the Cell link: field, select the cell where the


numeric value of the selection will be placed.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 53


Action 2.3 - Adding a Combo Box Control

Instructions: Results/ Comments:


1. Open the MonthlyTotalsNew.xlms file. [Ctrl+O], It is located in the course Data
Files folder.

2. Click the [Enable Content] button and This file has all the worksheets needed
examine the structure of the file. already built.

3. Activate the Control Sheet. This worksheet has the list of months for
the Combo Box drop-down list.

4. Double click cell D9 and examine the This cell has a nested If formula designed
formula in the cell. to pull information from the appropriate
worksheet depending on the month
selected from the Combo Box list.

5. Tap the [ESC] key to exit editing the


formula without changing anything.

6. Activate the Main sheet and select cell


A16 and type in;
< Month >.

7. Click the Developer Tab, in the Controls The list of controls are displayed.
Group click the [Insert] button.

8. Select the Combo Box control. The second option in the top row.

9. Set the cursor over the upper left corner The Combo Box control has been added to
of cell B16, click and drag over to lower the worksheet.
right corner of cell C16.

10. Right-click the control and choose The Format Control dialog opens.
Format Control from the contextual
menu.
The Alt Text tab is now active.
11. Click the Alt Text tab.
You have added text that will be read
12. Click into the Alternative text: field, and by screen reading applications for the
type in; visually impaired.
< Choose a month from the list >.
The Control tab is now active.
13. Click the Control tab.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 54
Action 2.3 - Adding a Combo Box Control, continued

Instructions: Results/ Comments:


14. Click into the Input range: field, then The Collapse Dialog button is located at
click the [Collapse Dialog] button and the right side of the input field. These cells
select the Control sheet and select cells contain the information to be added to the
B2:B7. Combo Box drop-down.
Click the [Expand Dialog] button to
show the full dialog again.

15. Click into the Cell Link: field, then click When a choice is made from the list of
the [Collapse Dialog] button and select options, the numeric value of that choice's
the Control sheet and select cell C9. position in the list will be entered into this
Click the [Expand Dialog] button to cell.
show the full dialog again.

16. Click the [OK] button. The Format Control dialog is closed and the
changes applied to the control.

17. Select cell D16 and type in; This is a 3D reference back to cell D9 on
< =Control!D9 >. the Control worksheet.
and press the [Enter] key.

18. Click the Combo Box control and choose As you make a selection from the list the
a month from the list to see the value in value displayed in D16 shows the amount
cell D16 change. of units sold in relation to the month
chosen.

19. Save the file. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 55
Lesson 2: Form Controls

Adding A Group The Group Box Control


Box Group box controls used to group and label sets of related
controls. Use a group box or a frame control to visually organize
related items on a form. Think of a set of choices in response to
a question like Age, where users are to choose from a series of
options.

Adding the Group Box Control


› Click the [Insert] button in the Controls Group on the
Developer Tab.
› Choose the Group Box option, it is the first option in the
second row of Form Controls.

› Draw out the Group Box where you want it on the


worksheet.
› The Group Box will be named Group Box
by default. As you create others, they will be
numbered as well.
› Right-click the default text and chose Edit Text from the
contextual menu.

Page 56 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Adding An Option Button Controls


Option Button Option Button controls look and function like Radio buttons
and are good to use within Group Boxes. As the user selects an
option the Cell Link will return the numeric value of the choice
made. The values are set by the order of the button's creation.

Adding Option Button Controls


› Click the [Insert] button in the Controls Group on the
Developer Tab.
Do not
deselect the › Choose the Option Button option, it is the last option in
Option Button the first row of Form Controls.
control before creating
the next one. If you do
the series of Option
buttons will not be
related. In essence
you will create two
separate lists of
choices.

When drawing
the new Option › Click where you would like the Option Button placed
buttons, do not to use the default size or draw out the Option Button
let their edges touch to size where you want on the worksheet.
the edge of the Group
Box control or they › Continue adding Option Buttons for each choice
will not be part of you want to make available. (Remember not to
the options set in the deselect the completed Option Button before
Group Box.
creating the next.)
› Right-click the default text and chose Edit Text from the
contextual menu.
Selecting and Arranging a group of Option Buttons
Once all the Option Buttons have been created and named, you
may want to align and distribute them so as to make them look
well organized.
› To select a control: right-click the control.
› Hold the [CTRL] key and click each subsequent
control.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 57


Lesson 2: Form Controls

Adding An › Activate the Format Tab in the ribbon

Option Button, › Click the [Arrange] button in the Arrange Group to


continued access alignment options.

› Choose the appropriate option.

Adding Functionality to the Option Buttons


› Select all the related Option Buttons.
› Use same method as described earlier.
› Right-click any of the selected buttons and choose
Format Object from the contextual menu.
› In the Format Controls dialog you will notice a new
tab for formatting the appearance of the controls.

Page 58 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Adding An › Select the Control tab

Option Button, › Set the Value as Unchecked.


continued › Set the Cell link: to where you want the value of
the selected option to be returned.
› Click the [OK] button to apply the changes to the
Option Button set.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 59


Action 2.4 - Adding a Radio Button Group

Instructions: Results/ Comments:


1. The MonthlyTotalsNew.xlms file should If not reopen the file.
still be open.

2. Activate the Developer Tab.

3. Click the [Insert] button drop-down in This will be the first option in te second
the Controls Group and select the Group row.
Box option.

4. Set the cursor over the top left corner of You are defining the size and location of
cell B18 and drag down to lower right the Group Box.
corner of cell C30.

5. Right-click the Group Box text and The text for the Group Box can now be
choose Edit Text from the contextual modified to suit your needs.
menu.

6. Type in;
< Months >
and delete the other existing text.

7. Do not deselect the control. The control must remain selected in order
for Excel to group the Group Box with the
Option Buttons to be added.

8. Click the [Insert] button drop-down in If necessary, reactivate the Developer Tab
the Controls Group and select the Option to access this command.
Button option.

9. Click over the middle of cell B19. The Option Button is added, using the
default size and text.

10. Right-click the Option Button control The Option Button label is active and can
and choose Edit Text from the contextual be modified.
menu.

11. Type in; This is the first radio button option of the
< January> list you are creating within the Group Box.
and delete the other existing text.

12. Do not deselect the control.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 60
Action 2.4 - Adding a Radio Button Group,continued

Instructions: Results/ Comments:


13. Repeat steps 8 through 12 for each of the When creating each Option Button, create
remaining months to June. them two cells below the one above.

14. Right-click the last control you edited The Format Controls dialog opens, notice
and choose Format Control from the you now also have access to a Color and
menu. Lines Tab in the dialog.

15. Activate the Control Tab in the dialog.

16. Leave the Value as Unchecked.

17. Click into the Cell link: field and select This will populate the cell link with
cell C9 on the Control worksheet. the numeric value of the Option Button
selected.

18. Click the [OK] button. The Format Control dialog closes.

19. Hold the [CTRL] key and click each of By holding the [CTRL] key while clicking
the Option Button controls in the Group each Option Button, you are adding to the
Box. current selection.

20. Activate the Format Tab in the ribbon. The formatting controls are available.

21. Click the [Align] drop-down button in The selected objects are now all aligned.
the Arrange Group and select Align Left.

22. Click the [Align] drop-down button in The selected objects are now all evenly
the Arrange Group and select Distribute spaced apart.
Vertically.

23. Deselect the controls. Click into any cell on the worksheet.

24. Test the radio buttons you just made. As you click one Option Button the
number of units sold that month are
displayed.

25. Save the file. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 61
Lesson 2: Form Controls

Adding A Button The Button Form Control


› Select the Developer Tab.
› Click [Insert].
› Select the [Button] control.
› Draw a button shape on the spreadsheet and the
following dialog box will be displayed.
If the file already has
macros in it they are
displayed in the list.

› Type in a Macro Name for your button.


› Click [Record]. The Record Macro dialog box is
If you click [New]
displayed.
instead of [Record] › Type in the Macro name: and Description:. Click
you will be taken
to the Visual Basic
[OK].
Editor to type in the
commands.

› Go through the steps needed for your button action.


When finished, make sure you stop recording.
› To change the name on the button, right-click the
button and choose Edit Text.

Page 62 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls

Assigning a Assigning a Macro to a Form Control


Macro to a Form Before you assign a Macro, you should make sure that the
purpose of the button is clear.
Control Changing the Name of the Form Control Button
› Right-click on the Form Control.
› Choose Edit Text from the shortcut menu.
› Select the default text and type a short, descriptive name.
If you select the Format Control option from the pop up menu,
you can change the font type and size of the button’s text as well
as other attributes.

Assigning or Recording a Macro


› Right-click on the Form Control.
› From the shortcut menu, choose Assign Macro.. (The
label control and the group box control do not have a
Macro option available on the menu.)
› The Assign Macro dialog box is displayed. You can
choose a Macro from the list to assign or you can
record a new one.

› Click [OK].
› If you choose to record a Macro, perform the steps you
want attached to the Form Control and then stop the
Macro.
› After you have assigned the Macro, you will be taken
back to the spreadsheet. Click away from your new
Form Control to deselect it. It is ready to use.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 63


Action 2.5 - Adding a Button

Instructions: Results/ Comments:


1. The MonthlyTotalsNew.xlms file should If not, reopen the file.
still be open.

2. Activate the Developer Tab.

3. Click the [Insert] button drop-down in The first button in the first row of options.
the Controls Group and select the Button
option.

4. Set the cursor over the top left corner To define the size and location of the
of cell E9 and drag down to lower right button.
corner of cell F10.

5. In the Assign Macro dialog choose As soon as you finish drawing out a button
CommandButton1_Click and then click the control the Assign Macro dialog appears.
[OK] button. You can choose to record a new macro or
use an existing macro.

6. Right-click the new button and choose The Format Control dialog opens, by
Format Control from the contextual menu. default to the Font tab.

7. On the Font tab in the Format Control You are defining the appearance of the text
dialog, set the font to Trebuchet, Bold, on the button.
and 14pt.

8. On the Alt Text tab; type in; You are adding accessibility to the button
< Click here to print the selected in order to be ADA compliant.
month's detail page >.

9. Click the [OK] button. The Format Control dialog closes.

10. Right-click the button again and choose


Edit Text from the contextual menu.

11. Replace the current text with < PRINT>. The button is now renamed.

12. Go to the Print Preview screen. [Ctrl+P].

13. Click the [Printer] drop-down button This will set the Adobe PDF Printer as the
and choose the Adobe PDF Printer from default printer. You may need to use the
the list of available printers. Microsoft XPS Document Writer.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 64
Action 2.5 - Adding a Button, continued

Instructions: Results/ Comments:


14. Exit the Print Preview screen. Tap the [ESC] key or click the [Go Back
Arrow] button in the upper left of the
screen.

15. Use the Option buttons or the Combo


Box to select a month.

16. Click the [Print] button. The Save PDF As dialog opens.

17. Save the PDF to the desktop without This way the PDF can be easily found later
changing the file name. if necessary.

18. Preview the PDF and close Acrobat. Acrobat opens the PDF, it should be a copy
of the month worksheet for the month you
choose.

19. Go back into the Excel file and try When the Save PDF As dialog opens,
changing the month choice and running simply replace the existing file on the
another print. desktop.

20. Preview the PDF and close Acrobat. Acrobat opens the PDF, it should be a copy
of the month worksheet for the month you
choose.

21. Save the file. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 65
Action 2. 6 - Examining the Print Macro

Instructions: Results/ Comments:


1. Activate the Developer Tab and click the The Macro dialog opens.
[Macros] button in the Code Group.

2. Select the CommandButton1_Click macro The selected macro is opened in the VBA
and click the [Edit] button. editor.

Sub CommandButton1_Click() Begins the macro and sets the trigger as


_Click()

Select Case ThisWorkbook.Sheets("Control"). This line defines where the macro will
Range("D9") look to see the Case to print.

Case 1 If Control!$C$9 has the value of 1 in it


Call PrintJan then Case 1 will call the PrintJan macro.
Case 2 If Control!$C$9 has the value of 2 in it
Call PrintFeb then Case 2 will call the PrintFeb macro.
Case 3 If Control!$C$9 has the value of 3 in it
Call PrintMar then Case 3 will call the PrintMar macro.
Case 4 If Control!$C$9 has the value of 4 in it
Call PrintApr then Case 4 will call the PrintApr macro.
Case 5 If Control!$C$9 has the value of 5 in it
Call PrintMay then Case 5 will call the PrintMay macro.
Case 6 If Control!$C$9 has the value of 6 in it
Call PrintJun then Case 6 will call the PrintJun macro.

End Select

End Sub Completes the macro.

3. Close the VBA editor without making any


changes.

4. Now to look at the Print(Month) macro. The Print(Month) macros were each
created as recorded macros.

5. Activate the Developer Tab and click the The Macro dialog opens.
Macros button in the Code Group.

6. Select the PrintApr macro and click the The selected macro is opened in the VBA
Edit button. editor.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 66
Action 2. 6 - Examining the Print Macro, continued

Instructions: Results/ Comments:


Sub PrintApr() Definition of macro begins.
'
' PrintApr Macro Macro name, macro metadata.
'
'Sheets("April").Select Defines which worksheet is to be selected.

ActiveWindow.SelectedSheets.PrintOut Activates the print command and sets


Copies:=1, Collate:=True, _ number of copies and other general print
IgnorePrintAreas:=False settings.

Sheets("Main").Select Makes the Main worksheet as active.

End Sub End of the macro.

7. Close the VBA editor without making any


changes.

8. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 2: Form Controls, Page 67
Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Lesson 3: Hyperlinks
and Connecting to the
Internet
Lesson Overview

You will cover the following concepts in this


chapter:
› What is a Hyperlink
› Creating a Hyperlink
› Modifying Hyperlinks
› Querying Data from a Website
› Editing A Query
Lesson Notes
Lesson 3: Hyperlinks and Connecting to the Internet

What is a In this lesson, you will learn about hyperlinks and the Internet.
You will learn how to insert hyperlinks into a worksheet, modify
Hyperlink hyperlinks in a worksheet, and browse hyperlinks in Excel.

What is a Hyperlink?
A hyperlink is an object in a file that links to another location in
the same file, or to another file altogether.

Some important points to remember:

› A hyperlink is used as an active link to another object.


› Hyperlinks usually appear in the form of an underlined
word or phrase in a bright blue font. Hyperlinks can be
created on a word, phrase, symbol, picture, or graphic.
› Each hyperlink to a web location has an address called a
URL (uniform resource locator) associated with it. A URL
is associated with a hyperlink to provide information on
how to retrieve the linked object. A typical URL could look
something like: http://www.something.org.
› You can create hyperlinks to locations within the same file,
local or remote files, Web pages, media objects, and e-mail
recipients.
› Hyperlinks should link to publicly available files or Web
pages. For example, if Sue sends me a workbook with
a hyperlink to a file on her computer, I am probably not
going to be able to access that file (unless we are on the
same network and that file or folder is shared).

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 71


Lesson 3: Hyperlinks and Connecting to the Internet

Creating a Inserting Hyperlinks


› Select the cell that will contain your hyperlink.
Hyperlink
› Select the Insert Tab.
› Click the [Hyperlink] button.
› The Insert Hyperlink dialog box will be displayed.
Another way › Under the Link to: heading, choose what you want
to create a to link to. The information the dialog box will ask for
hyperlink in a depends on which of the following you choose.
worksheet is
to select a cell, › Existing File or Web Page
right-click on it,
and choose the › Place in This Document
Hyperlink option
from the shortcut › Create New Document
menu. Or, press
› E-mail Address
[Ctrl+K].
› In the Text to display: field, located at the top of the
dialog box, type the text for your hyperlink if there
isn't already text in the cell. This text will appear as
a blue underlined hyperlink in the cell that you have
selected.
› When you are finished making your selections, click
[OK], You will be returned to your worksheet and the
linked text will be underlined.

Page 72 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet

Creating a Link to Existing File or Web Page


Hyperlink, 6. Screen Tip

continued
1. Look In
2. Current Folder

3. Browsed Pages 7. Bookmark


4. Recent Files
5. Address:

Look in: Field


› Current Folder displays in the drop-down list the files
and subfolders of the current folder.
› Browsed Pages displays a list of the URL’s for Web
pages you recently visited.
› Recent Files displays a list of recently accessed files.
Address: Field
› The file or object referred to in the address field will
be the target of the hyperlink. Making a selection from
any of these lists will enter the URL (or address) of
the file into this field or type a URL for a Web page or
To find the URL remote file, or the path to a local file directly into the
of a website, Address: field.
click on the
[Browse the Web] Screen Tip... Button
button, navigate to › Click this button to add a brief comment that will
the page in your
browser and simply
appear when the mouse pointer hovers over the
minimize the hyperlink. The text will also be read by screen reading
browser. The URL programs for the visually impaired.
will appear in
the Address: Bookmark... Button
field. › Click to link to an existing bookmark in an Excel
workbook. First, select the Excel file from the list, and
then click the [Bookmark] button to specify the exact
location within the selected workbook.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 73


Lesson 3: Hyperlinks and Connecting to the Internet

Creating a Link to Place in this Document


Hyperlink, This type of link can be useful when writing macros to navigate
continued through the workbook.
Text to display: Field
› This is the text that will show in the cell. You can type
it directly into this field or you can type it in the cell
prior to clicking the [Hyperlink] button.
Type the cell reference: Field
› This will be the cell location on the sheet designated
in the Or select a place in this document: list. It could
be in the current sheet or on another sheet in this
workbook.
Or select a place in this document: Field
› This shows a list of worksheets and range names in the
current workbook to choose from.
Screen Tip... Button
› Click this button to add a brief comment that will
appear when the mouse pointer hovers over the
hyperlink.

Link to Create New Document


Text to display: Field
› This is the text that will show in the cell. You can type
directly into this field or you can type it in the cell prior
to clicking the [Hyperlink] button.
Name of new document: Field
› Type an appropriate name in the text box.
Full path Field
› Displays the current location and the name of the new
workbook. Click [Change] to select a new location.
When to edit: Field
› If you choose to Edit the new document now, the new
spreadsheet will be opened when the hyperlink is
activated.
Screen Tip... Button
› Click this button to add a brief comment that will
appear when the mouse pointer hovers over the
hyperlink.

Page 74 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet

Creating a Link to E-mail Address


Hyperlink, Text to display: Field
› This is the text that will show in the cell. You can type
continued
directly into this field or you can type it in the cell
prior to clicking the [Hyperlink] button.
E-mail address: Field
› Type the e-mail address of the recipient of the
automated E-mails.
Subject: Field
› Type a subject for your e-mail if you would like this
automatically filled in.
Recently used e-mail addresses: Field
› A list of e-mail addresses you have already used.
Screen Tip... Button
› Click this button to add a brief comment that will
appear when the mouse pointer hovers over the
hyperlink.

To Follow a Hyperlink in Excel


› Trace over the link until the mouse pointer turns into a
pointing hand.
› Click on the hyperlink. You will be taken to the
location of the link - even if it is in another application
such as Microsoft Word, Access, or on the Web.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 75


Action 3.1 - Creating Page Navigation Hyperlinks

Instructions: Results/ Comments:


1. Open the file named SheetNavigation. Located in your class data folder.
xlsx.

2. Save the file as My Links [F12].

3. On Main sheet select cell C1.

4. Type: < Jan >.


This is a regular text label for a cell.
5. Select cell C1 and use the autofill handle
across to cell H1.

6. Reselect cell C1.

7. Click the Insert Tab and click the [Ctrl+K].


[Hyperlink] button. The Insert Hyperlink dialog opens.

8. In the Link to: field, click A list of all the sheets in the workbook are
[Place in This Document]. displayed.

9. Select Jan from the list Jan is the sheet name.

10. Click the [Screentip...] button next to the The Set Hyperlink ScreenTip dialog opens.
Text to display: field.

11. In the ScreenTip text: field type in; This text will be displayed as the user
< Click here to go to the Jan sheet. > hovers over the link, it will also be read
and click the [OK] button. aloud by screen reading applications.
(ADA compliance)

12. Click the [OK] button. The Insert Hyperlink dialog closes.

13. Click the link to verify that it works. The Jan sheet should now be the active
worksheet.

14. Reactivate the Main sheet. Click on the Main sheet tab.

15. Repeat steps 7 through 10 to create Direct each link to the correct worksheet
links for Feb through Jun in cells D1:H1 and adjust the ScreenTips accordingly.
respectively.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 76
Action 3.1 - Creating Page Navigation Hyperlinks, continued

Instructions: Results/ Comments:


16. Select cells C1:H1 on the Main sheet tab [Ctrl+C] to copy or right-click and choose
and copy the cells. Copy from the menu.

17. Select the Jan through Jun sheets. Click the Jan sheet tab, hold the [Shift] key
and click the Jun sheet tab.

18. Click into cell C1 and paste the copied [Ctrl+V] to paste or right-click and choose
cells. Paste from the menu. All the worksheets
selected now have the sheet navigation
links pasted.

19. Save the file and leave it open. [Ctrl + S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 77
Action 3.2 - Adding a hyperlink to an Object

Instructions: Results/ Comments:


1. My Links should still be open. If not, reopen the file.

2. Activate the Jan sheet tab.

3. Click the Insert Tab, in the Illustrations The list of available shapes are displayed
Group, click the [Insert Shape] button in the drop-down.
drop-down.

4. Choose the Rounded Rectangle. The sixth button in the top row of options.

5. Draw out the shape starting at the upper To define the size and location of the
left corner of cell A1 to A2. shape.

6. Type in:; The shape is a textbox by default so you


< HOME >. are simply adding text to the textbox.

7. Right-click the shape and choose Format The Format Shape pane opens on the right
Shape from the menu. side of the screen.

8. In the Format Shape pane, click Shape Options pertaining to shape size and
Options then the [Size & Properties] properties are displayed in the pane.
button.

9. Expand the Textbox set of controls and The text is now vertically centered.
set the Vertical alignment to Middle.

10. Expand the Properties set of controls and If this sheet is printed, the button will not
uncheck the Print Object checkbox. be included in the print.

11. Close the Format Shape pane. Click the [Close] button in the Format
Shape pane.

12. Click the Home Tab, in the Alignment The text is now also horizontally centered
Group, click the [Center Align] button. in the shape.

13. Select the shape if necessary.

14. Click the Insert Tab, in the Links Group, [Ctrl+K] or right-click the shape and
click the [Hyperlink] button. choose Hyperlink from the menu.

15. In the Link to: field, click This will be another internal link.
[Place in This Document].
Excel 2019: Level 3, Rel. 1.0, 11/11/2019
Lesson 3: Hyperlinks and Connecting to the Internet, Page 78
Action 3.2 - Adding a hyperlink to an Object, continued

Instructions: Results/ Comments:


16. Select Main from the list To define what sheet will be active when
the link is clicked.

17. Click the [Screentip...] button next to the The Set Hyperlink ScreenTip dialog opens.
Text to display: field.

18. In the ScreenTip text: field type in; You are making this link ADA compliant.
< Click here to go Back to the Main
sheet. >
and click the [OK] button. The Set Hyperlink ScreenTip dialog closes.

19. Click the [OK] button. The Insert Hyperlink dialog closes.

20. Select and copy the shape. [Ctrl+C] or right-click the shape and
choose Copy from the menu.

21. Go to cell A1 on each of the remaining [Ctrl+V] or right-click the shape and
month worksheets and paste the choose Paste from the menu.
hyperlinked shape into place.

22. Test the links. Using the links, you should be able
to move back and forth through the
worksheets.

23. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 79
Action 3.3 - Adding a Hyperlink to a Website

Instructions: Results/ Comments:


1. My Links should still be open. If not, reopen the file.

2. Activate the Main sheet tab.

3. Select cell A3 and type in; This will be a link to a website.


< Home Page >.

4. Deselect and reselect cell A3. [Ctrl + Enter].

5. Click the Insert Tab, in the Links Group, [Ctrl+K] or right-click the cell and choose
click the [Hyperlink[ button drop-down. Hyperlink from the menu. The Insert
Hyperlink dialog opens.

6. In the Link to: field, click


[Existing File or Web Page].

7. Click into the Address: field and type in This is the URL where the link will direct
< www.tcworkshop.com >. your browser to open.

8. Click the [ScreenTip] button. The Set Hyperlink ScreenTip dialog opens.

9. Add helpful screentip text and click the You are making this link ADA compliant.
[OK] button. Think about text that clearly lets the user
know what to expect when clicking this
link. The Set Hyperlink ScreenTip dialog
closes.

10. Click the [OK] button. The Insert Hyperlink dialog closes.

11. Test the link. A browser window opens to the web page
listed in the link.

12. Close the browser.

13. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 80
Action 3.4 - Adding an E-mail Hyperlink

Instructions: Results/ Comments:


1. My Links should still be open. If not, reopen the file.

2. Activate the Main sheet tab.

3. Select cell A5 and type in; This will be a link that opens a new E-mail
< Contact Us >. message.

4. Deselect and reselect cell A5.

5. Click the Insert Tab, in the Links Group, [Ctrl+K] or right-click the cell and choose
click the Hyperlink button drop-down. Hyperlink from the menu. The Insert
Hyperlink dialog opens.

6. In the Link to: field, click The E-mail screen is active in the Insert
[E-mail Address]. Hyperlink dialog.

7. Click into the E-mail address: field and This is who will receive any E-mails sent
type in; by clicking the link.
< [email protected]>.

8. Click into the Subject: field and type in; This will be the default subject line of any
< More Info>. E-mails sent.

9. Click the [ScreenTip] button. The Set Hyperlink ScreenTip dialog opens.

10. Add helpful screentip text and click the You are making this link ADA compliant.
[OK] button. The Set Hyperlink ScreenTip dialog closes.

11. Click the [OK] button. The Insert Hyperlink dialog closes.

12. Test the link. If there is an active E-mail program, a new


message window opens with both the
recipient and subject lines filled in. If there
is no active E-mail program, Outlook will
open to the point where you can begin to
setup the program.

13. Do not configure an Outlook account. Exit the setup screen or close the new
email window.

14. Save the file. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 81
Lesson 3: Hyperlinks and Connecting to the Internet

Modifying Modifying Hyperlinks


Hyperlinks To change an existing hyperlink, do the following:
› If you are only changing the name of the link that
appears in the cell, you can select the text in the
Formula Bar and type the new name. If you need to
change other items, right-click on the link to change
and continue to the next step.
› Choose Edit Hyperlink from the shortcut menu.
› The Edit Hyperlink dialog box is displayed for the type
Remove of link you created.
Hyperlink and You can now change the location for the hyperlink, the
Open Hyperlink are
ScreenTip, or the Text to display. You can also remove the
also options on the
drop-down menu, hyperlink from the worksheet by clicking the [Remove Link]
available when button. When you are finished with your modifications, click
you right-click on a [OK] to apply them.
hyperlink.

Changing the Attributes of the Selected Hyperlink


Hyperlinks will generally appear in one color (bright blue by
default) before they have been clicked, and in another color
(purple by default), after they have been clicked.

› Right-click on the hyperlink


› Choose Format Cells from the drop-down menu.
› The Format Cells dialog box is displayed.

› Change the font color, size, border, shading, and


alignment of the link as desired.
› Click [OK].

Page 82 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet

Modifying Changing the Attributes of All Hyperlinks


Hyperlinks, The method just described will allow you to modify individual
hyperlinks, but what about modifying the default color and font
continued
size for all hyperlinks?
› Select the Home Tab.
› Locate the Style Group.
› Click the [Cell Styles] button to display the pre-set cell
styles or use the [More] button to expand the gallery if
it is already displayed.
› Find the Hyperlink style.
› Right-click it and choose Modify from the menu that is
displayed.
› This will display the Style dialog box.

› Make sure that the word Hyperlink appears in the


Style name: field.
› Observe the checkmark next to the word Font. This
means that the style for hyperlinks currently includes
only font settings.
› Click the [Format] button to display the Format
Cells dialog box where you can make changes to the
borders, shading, font size, font color, and alignment
for all hyperlinks.
› When you are finished, click the [OK] button in the
Format Cells dialog box to return to the Style dialog box.
› Notice the additional checkmarks and descriptions.
Click the [OK] button.
The style changes are made to any current link that was
not changed individually and will be the format for every
new hyperlink you create.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 83


Action 3.5 - Modifying a Hyperlink

Instructions: Results/ Comments:


1. My Links.xlsx should still be open. If not, reopen it.

2. Make sure you are on your Main If not, click the worksheet tab for Main.
worksheet.

3. Right-click on the link in cell A3 and The Edit Hyperlink dialog box is displayed.
select Edit Hyperlink from the shortcut
menu.

4. Click in the Address: field, and change The link will now open Google when
the address to clicked.
< www.google.com >.

5. Click [OK]. To close the Edit Hyperlinks dialog box.

6. Test the link. A browser window opens to the web page


listed in the link.

7. Close the browser.

8. Select cells C1:H1.

9. Right-click on the selection and choose The Format Cells dialog box is displayed.
Format Cells from the shortcut menu.

10. On the Font Tab, make the following


changes:
Font: Courier New, Style: Bold,
Size: 12 pt, Color: to Red Accent 2 Darker
25%

11. On the Alignment Tab, change the Text


alignment Horizontal setting to Center.

12. Click [OK]. The dialog closes and the formatting


changes are applied

13. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 84
Lesson 3: Hyperlinks and Connecting to the Internet

Querying Data Excel offers new tools that allow querying data from external
sources. These tools are found in the new Get & Transform
from a Website Group on the Data Tab. While the new Power Query and
Power Pivot tools are outside the scope of this book, we will be
examining how to use the New Query to gather information from
websites.

Website data must New Query from Web


be stored as a table › Click the [From Web] button in the Get & transform
in order for Excel
Group.
to be able to import the
data.

- OR -.
› Click the [Get Data] button drop-down and choose
From Other Sources then From Web.

Using either method will open the From Web dialog

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 85


Lesson 3: Hyperlinks and Connecting to the Internet

Querying Data › The From Web dialog opens.

from a Website,
continued

› Enter the web address into the URL field and click
the [OK] button.
› The Web Access Content dialog opens.

› Should the website require signing in, you are able


to enter any information used to sign into the site in
this dialog.
› If the site does not require signing in then leave the
default settings and click the [Connect] button.
› The Navigator dialog opens.

Page 86 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet

Querying Data › In the Display Options area, a list of all the different
tables on the web page are displayed.
from a Website,
continued › These may or may not be named, depending on
how the site is using HTML labels to define the
tables.
› You are able to choose a single table or by checking
the Select Multiple Items checkbox select more
than one table to connect to.
› When choosing a single table, a preview is displayed
on the right side of the dialog.

› The selected table from this web page will be


connected to and imported.
› There are two options for the preview at the top of
this section of the Navigation dialog, either as Table
or Web view.
› The Table View shows the data as an unformatted
table.
› The Web View shows the table as it appears on the
web page.
› When selecting more than one table the preview
area displays the highlighted table in the Display
Options area.
› Once the tables are selected, click the [Load] button to
load the data into a new worksheet

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 87


Action 3.6 - Gathering Data from a Website

Instructions: Results/ Comments:


1. Open the new blank Excel file. The file is in the lessons folder.

2. In the data files folder, open the This will act as an active web site for
ClassTable.html file in a browser the exercise. To copy the url, [Ctrl+C]
window. Copy the url in the address or right-click and choose Copy from the
bar. menu.

3. Click into cell A1 of the blank Excel file [Ctrl+V].


and paste the url.

4. Save the file as WebClassList.xlsx. [F12].

5. Select cell A1, and copy it. [Ctrl+C] or right-click and choose Copy
from the menu.

6. Click the Data Tab, in the Get & The From Web dialog opens.
Transform Group, click the [From Web]
button.

7. Click into the URL field and paste the [Ctrl+V] or right-click and choose Paste
copied link. from the menu.

8. Click the [OK] button. The Web Access Conent dialog opens.

9. Leave the setting as they are and click the Take a few moments to explore this dialog.
[Connect] button. when you click the [Connect} button the
Navigation dialog opens.

10. From the Display Options area, select A preview of the data in that table
the Table from the list of tables. is displayed on the right side of the
Navigation dialog.

11. Click the Web View tab. The preview now shows what the table
looks like on the site.

12. Click the back to the Table View tab. The preview shows simple table view.

13. Click the [Load] button. The data from the selected table is added
in cell A1 of a new worksheet.

14. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 88
Lesson 3: Hyperlinks and Connecting to the Internet

Editing A Query Removing Unnecessary Data from a Query


Once the data connection is established and the data added on a
worksheet in the workbook, you may realize there is unnecessary
data in the table. When the data table is selected, or any cell
within the table the Query Tab is displayed on the ribbon.
This tab is
a contextual
tab and is only
displayed when the
table or a cell within
the table is actively
selected.

Editing the Table


Editing the › Click the [Edit] button in the Edit Group on the Query
query can also Tab.
be done when
connecting to the › The (Table Name) Power Query Editor window opens.
source data. From
within the Navigator
dialog, after selecting
the table to be
imported, click the
[Edit] button to access
the Power Query Editor
window.

› Columns that need to be edited are selected by clicking


the column header.
› Once a particular column is actively selected, it can be
split or removed from the data set.
› You can also choose specific rows of data to keep from
the table by using the [Reduce Rows] button drop-
down.
› The data may also be filtered, to import only required
information.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 89


Lesson 3: Hyperlinks and Connecting to the Internet

Editing A Query, › As changes are made, they are listed in the Applied
continued Steps of the Query Setting pane of the editor.

› To Undo any change: select the change and click


the [X] button to remove the specific change.

› To see how the changes will affect the table click the
[Refresh Preview] button in the Query Group on the
Home Tab of the Query Editor dialog.
› When all changes are completed, click the [Close &
Load] button in the Close Group on the Home Tab of
the Query Editor dialog.

Page 90 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet

Editing A Query, Splitting a Column


continued › Select the column to split into multiple columns.
› Click the [Split Columns] button drop-down, two
options are available:

› Delimiter- choose this option if there is a common


character that can be used as a marker of where the
data can be split. (This is the choice for the example
used here.)
› By Number of Characters- choose this option if
there is a common prefix that can be used as a
marker to define where the data is to be split.
› If the Delimit option is chosen, the Split Column by
Delimiter dialog opens.

› The Select or enter delimiter field drop-down


offers a variety of common characters to choose
from, including Custom.
› Choosing Custom from the list of delimiters adds a
field where you can enter the character to use as the
delimiter.
› Click the Advanced Options drop-down to expand
more options on how the data will be split.
› Click the [OK] button when done to apply the changes.
› Click the [Close & Load] button to finish editing the
query.

Refreshing the Data


Click the [Refresh] button in the Load Group on the Query Tab.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 91


Action 3.7 - Editing the Query

Instructions: Results/ Comments:


1. The WebClassList.xlsx file should still If not, then re-open the file.
be open.

2. Click any cell in the data table that was To make the data table active and display
just added to the workbook. the Query Tab in the ribbon.

3. Activate the Query Tab in the ribbon.

4. In the Edit Group, click the [Edit] button. The Power Query Editor window opens.

5. Select the third column header (Course_ The column is highlighted.This column
ID) in the preview. will be split into three separate columns.

6. In the Transform Group, click the [Split The Split Column by Delimiter dialog opens.
Column] button drop-down and choose
By Delimiter.

7. Choose Space from the Select or enter Each part of the date field has been put
delimiter field, into it's own column.
Then select the Right-most delimiter radio
button and click the [OK] button.

8. Right-click the first column header The column has been given a name in-line
(Course_ID.1) in the preview and choose with the data it contains.
Rename, name the column as Course_ID.

9. Rename the Course_ID.2 column as Repeat step 8.


Program.

10. Select the last column header (client_id)


in the preview.

11. In the Manage Columns Group, click the The column is removed from the preview.
[Remove Columns] button.

12. Select the second column header (Class_


Reference) in the preview.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 92
Action 3.7 - Editing the Query, continued

Instructions: Results/ Comments:


13. In the Manage Columns Group, click the The second unnecessary column of data is
[Remove Columns] button. removed from the preview.

14. In the Applied Step field of the Query The preview of the data reverts back to
Settings pane, try selecting different how the data was shaped at that stage of
steps taken in shaping the data. the edit.

15. On the Home Tab, click the [Close & The data is returned to the worksheet in
Load] button. the way it has been shaped.

16. Click the [Refresh] button in the Load The data in the table is updated based on
Group on the Query Tab. the information from the website.

17. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 3: Hyperlinks and Connecting to the Internet, Page 93
Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Lesson 4: Outlining,
Subtotals, and
Consolidation
Lesson Overview

You will cover the following concepts in this


chapter:
› Outlining
› Automatic Outlining
› Exploring Outlined Data
› Grouping Data Manually
› Creating Subtotals
Lesson Notes
Lesson 4: Outlining, Subtotals, and Consolidation

Outlining Sometimes, a worksheet can become so large and contain so


much data that it becomes unwieldy. Totals and subtotals that
summarize the data are lost on screen after screen of numbers.
Excel has an excellent feature to help with this kind of problem.

Excel’s Grouping and Outlining features will allow you to


collapse a large worksheet to show or print summary data, and
to expand the same worksheet to show or modify the details. You
will find these features in the Outline Group on the Data Tab.
The Automatic Outlining feature makes outlining a worksheet

fairly straightforward. It works best with numerical data


organized into groups and sub groups by formulas or functions.
The following worksheet, for example, contains monthly
financial data for a business, organized into quarterly and yearly
totals using formulas and the SUM function.

It can be difficult to discern quarterly and yearly totals at a


glance because these figures are lost among the other data.

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 97


Lesson 4: Outlining, Subtotals, and Consolidation

Automatic Using an Automatic Outline


Outlining › Select the Data Tab and locate the Outline Group.
› Click the down arrow under the [Group] button.

The worksheet › From the drop-down menu, choose Auto Outline.


must have
formulas in › The spreadsheet is automatically outlined based on
place in order to use Total Rows in the spreadsheet.
the Auto Outline
feature.

› All of the original data is shown, as well as Outline


Grouping indicators and collapse buttons marked with
a (-). In this example, the quarters are grouped together
to be summarized by Quarterly Totals, and each year
has been grouped to be summarized by Yearly Totals.
Notice also that the columns Supplies, Wages, and
Rent have been grouped under Total Expenses, and
that there is an over arching group of all columns
under Profit.

Page 98 Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation

Exploring One of the benefits of outlining is that is eliminates detail


information and only shows Totals. In the figure below, you can
Outlined Data see the summary results of Excel’s Automatic Outline.
The original information is still available in all of its detail, but
it is now presented in a summary view, showing only the yearly
profit totals.

If an Outline is
collapsed, only the
data that is visible
on your screen will be
printed.
Showing or Hiding Outlined Data
After the spreadsheet is outlined, you will see outline symbols
above and to the left of your spreadsheet.

Do one or more of the following to Expand or Collapse the


detail data in the Outline:
› To display or hide the entire outline to a specific
level, click the number of the level you want.

Column Outline Levels

Row Outline Levels

› To display detail data within a group, click the


expand button marked with a [+] sign.
› To hide the detail data for a group, click the
collapse [-] button.

Expand Button

Collapse Button

- OR -

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 99


Lesson 4: Outlining, Subtotals, and Consolidation

Exploring › Select a cell within a level group and click the desired
button to show or hide the detail of group
Outlined Data,
continued Show Detail

Hide Detail

Removing an Automatic Outline


› Select the Data Tab and locate the Outline Group.
› Click the down arrow under the [Ungroup] button.

› From the drop-down menu, choose the Clear Outline


option.

Page 100 Excel 2019: Level 3, Rel. .0, 11/11/2019


Action 4.1 - Using Auto Outline

Instructions: Results/ Comments:


1. Open the file Outline.xlsx in your This worksheet contains monthly,
exercise files folder. quarterly, and yearly sales data. It is
numerical data that uses formulas and
functions to calculate column totals. This
kind of worksheet is an ideal example for
Automatic Outlining.

2. Save the file as MyOutline [F12].

3. Click the Data Tab and click the [Group] The data in the worksheet is now
button on and choose Auto Outline. Outlined.

4. Examine the data. The outlining is based on how the


formulas break the data down.

5. Click both the number [1] buttons in the The data in the worksheet is collapsed
upper left area of the worksheet. down to the point where we only see the
profit totals for each year. Since the Yearly
Totals formulas are summing the quarters,
these are the top level formulas in the files
and are the Level 1 breakpoints.

6. Click the number [2] button of the Now the quarterly totals of all the years
horizontal row of numbered buttons in are now also displayed. The individual
the upper left area of the worksheet. [Expand] and [Collapse] buttons are
displayed within the second column on
the left side of the worksheet. The Level
2 formula are gathering the summing the
data in order to provide the values used
by the Level 1 formulas.

7. Click the number [2] button of the Now the Sales and Expenses columns
vertical column of numbered buttons in are displayed, along with the individual
the upper left area of the worksheet. [Expand] and [Collapse] buttons above
the worksheet.

8. Click the [Plus] buttons to expand each Each of the four quarters in the first year
of the Quarter in the first year. are expanded so you can see the detailed
data. The [Plus] buttons change to [Minus]
button when the group is expanded.

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 101
Action 4.1 - Using Auto Outline, continued

Instructions: Results/ Comments:


9. Click the [Minus] buttons of the first two Those two quarters detailed view is
quarters to collapse the groups. collapsed and the [Minus] are replaced
with [Plus] buttons.

10. Clicking the number [3] buttons will The highest number value buttons will
expand to show the data used by the displays all the source data used by the
formulas in the data set. formulas within the data set.

11. Click the Data Tab, in the Outline The Outlining features are removed and
Group, click the [Ungroup] button drop- you are working with a normal large data
down and choose Clear Outline. set on the worksheet.

12. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 102
Lesson 4: Outlining, Subtotals, and Consolidation

Grouping Data Automatic Outlining may not be possible for worksheets


with non-numerical values or with no distinctive totals (from
Manually formulas or functions). When Automatic Outlining does not, or
cannot, organize your data in the way you want, Excel displays
the following alert.

Although, you can manually group your data as required.

To Manually Outline Data


› Select the rows or columns that you want to group.
Select the Data Tab and locate the Outline Group.
Click the drop-down arrow on the [Group] button and
choose Group.

› If you select cells and not rows, a dialog box will be


displayed asking if you want to group by Rows or
Columns.

Excel will provide an outline indicator and a [collapse/expand]


button for the new grouping.
You will see numbered level buttons in the top left corner. These
buttons work like the ones in automatic outlines.

To Remove Manual Groupings


› Select the rows or columns corresponding to the
grouping you wish to remove.
› Click the drop-down arrow on the [Ungroup] button
and choose Ungroup or if the dialog box was displayed,
choose Row or Column and click [OK].

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 103


Action 4.2 - Grouping Manually to Create Outlines

Instructions: Results/ Comments:


Open the Grouping.xlsx file. The file is in the lessons folder.

1. Save the file as MyGrouping. [F12].

2. Click the Data Tab, in the Outline Since this file has no formulas, Excel is
Group, click the [Group] button drop- unable to determine how the data should
down and choose Auto Outline. be outlined and now displays the Cannot
create an outline screen.

3. Close the Notification screen.

4. Select columns B:D.

5. Click the Data Tab, in the Outline Columns B:D are now grouped. The
Group, click the [Group] button drop- outlining controls are added above the
down and choose Group. column headers.

6. Click the [Minus] button above the Columns B:D are collapsed out of view.
column headers.

7. Click the [Plus] button above the column The columns are re-displayed.
headers.

8. Select cells A5:A20.

9. Click the Data Tab, in the Outline You can also simply click the [Group]
Group, click the [Group] button drop- button itself. Since only cell were actively
down and choose Group. selected when click the [Group] button
Excel requires more direction on how
to group the data and opens the Group
dialog.

10. Choose Rows in the Group dialog and Rows 5:20 are now grouped and the
click the [OK] button. outlining controls are added to the left of
the row headers.

11. Click the [Minus] button to the left of the Rows 5:20 are collapsed out of view.
row headers.

12. Select rows 30:200.

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 104
Action 4.2 - Grouping Manually to Create Outlines, continued

Instructions: Results/ Comments:


13. Click the Data Tab, in the Outline A new group of rows is created.
Group, click the [Group] button.

14. Click the number [1] button on the All the row groups are collapsed.
horizontal number buttons.

15. Click the number [2] button on the All the groups are expanded, showing all
horizontal number buttons. the data.

16. Click any cell within a group.

17. Click the Data Tab, in the Outline The group related to the selected cell is
Group, click the [Ungroup] button drop- removed.
down.

18. Click any cell outside of an existing


group.

19. Click the Data Tab, in the Outline Since there wasn't a cell within a group
Group, click the [Ungroup] button drop- selected all group and outlining was
down and choose Clear Outline. removed.

20. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 105
Lesson 4: Outlining, Subtotals, and Consolidation

Creating Another kind of outlining or grouping technique available in


Excel is the Subtotals feature. If you have numeric data organized
Subtotals with clear column and row headings, you can use Excel to create
automatic Subtotals and Grand Totals for the data.

Ensure your dataset does not include blank columns and rows so
that Excel includes all of the data and include the headings.
To use the Subtotal
feature, your data Using the Subtotal Feature
should be sorted, › Click into the dataset you want to apply Subtotals to.
to break the data into an
organized structure. › Select the Data Tab and in the Outline Group, click the
[Subtotal] button. The Subtotal dialog box is displayed.
› Select the drop-down for At each change in: to choose
options for the number of rows that will be totaled.
Totals will be applied every time the values under the
chosen column label changes.

› Select the drop-down for Use function: to choose a


function (SUM, AVERAGE, COUNT, PRODUCT,
and STDEV) to apply to your data. The function you
choose will be used to calculate the totals.
› In the Add subtotal to: list, select which columns
to apply the totals. You can apply totals to a single
column or to multiple columns in the selected range.

Page 106 Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation

Creating › Put a checkmark in the options to:

Subtotals, › Replace current subtotals


continued › Page break between groups
› Summary below data

Removing Subtotals
› Select a cell in the range of data.
› Click on the [Subtotal] button in the Outline Group
on the Data Tab to reveal the Subtotal dialog box.
› In the Subtotal dialog box, click the [Remove All]
button.

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 107


Action 4.3 - Subtotaling

Instructions: Results/ Comments:


1. The MyGrouping.xlsx file should still be If not, then reopen the file.
open.

2. Click into any cell in the Sales Rep This will be the data used to organize the
column. data set.

3. Click the Data Tab, in the Sort & Filter The data is now organized by the sales
Group, click the [Sort A to Z] button. reps.

4. Click the [Subtotal] button in the The Subtotal dialog opens.


Outline Group on the Data Tab.

5. In the Subtotal dialog, click the drop- Subtotals will be added for each sales rep
down for the At each change in: field within the Sales Rep column.
and choose Sales Rep.

6. Leave the Use function: field as Sum. This is the function that will be used by the
subtotaling feature.

7. Check the Price checkbox in the Add Totals will be added to this column of
subtotal to: field. data.

8. Click the [OK] button. The subtotals are added to the data set
along with the Outlining tools.

9. Examine the data. You can now see the total sales by each rep
in the Price column as well as the grand
total of all sales.

10. Click the Data Tab, in the Outline You will now add more information to
Group, click the [Subtotal] button. the data set that did not exist before. The
Subtotal dialog opens.

11. Click the drop-down for the At each Subtotals will be added for each sales rep
change in: field and choose Sales Rep. within the Sales Rep column.

12. Set the Use function: field to Count. This function will count the number of
sales each rep has made.

13. Check the Price checkbox in the Add The count of sales will be added to this
subtotal to: field. column of data.

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 108
Action 4.3 - Subtotaling, continued

Instructions: Results/ Comments:


14. Uncheck the Replace current subtotals If this checked remains checked, the
checkbox. counts will replace the existing subtotals.

15. Click the [OK] button. The counts are added to the data set.

16. Examine the data. You can now see the sales counts by each
rep in the Price column as well as the total
count of all sales.

17. Click the number [1] button in the Only the grand totals are displayed.
horizontal outlining buttons.

18. Try the other outline number buttons to Groups of data are displayed depenent on
see how the data set is grouped. the numbered level chosen.

19. Click the number [4] button in the All the data is displayed.
horizontal outlining buttons.

20. Click the Data Tab, in the Outline The Subtotal dialog opens.
Group, click the [Subtotal] button.

21. Click the [Remove All] button and then All subtotals and outlining are removed
click [OK]. from the data set.

22. Click into any cell in the Course Name This will now be the column used to break
column. the data on with the subtotaling tool.

23. Click the Data Tab, in the Sort & Filter The data is resorted.
Group, click the [Sort A to Z] button.

24. Click the Data Tab in the Outline Group, The Subtotal dialog opens.
click the [Subtotal] button.

25. In the Subtotal dialog, click the drop- Subtotals will be added for each course
down for the At each change in: field name within the Course Name column.
and choose Course Name.

26. Leave the Use function: field as Sum. This is the function that will be used by the
subtotaling feature.

27. Check the Price checkbox in the Add Totals will be added to this column of
subtotal to: field. data.
Excel 2019: Level 3, Rel. .0, 11/11/2019
Lesson 4: Outlining, Subtotals, and Consolidation, Page 109
Action 4.3 - Subtotaling, continued

Instructions: Results/ Comments:


28. Click the [OK] button. The subtotals are added to the data set
along with the Outlining tools.

29. Examine the data.

30. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 110
Lesson 4: Outlining, Subtotals, and Consolidation

Consolidating When you consolidate workbooks, you are combining,


condensing, and summarizing data from multiple sources into
Workbooks one destination. For example, a large company may have sales
or profit data broken down into several different geographical
locations. Each workbook may have the same layout and
structure (template) but contain different data. With Excel, you
can consolidate the different workbooks, summarizing and
totaling the data in one place to get a combined view of your
information.

To consolidate workbooks in Excel, open the relevant workbooks


and choose a destination workbook where the data will be
consolidated. It is a good idea to set up the destination worksheet
to have the same layout as the worksheets that will supply
the data. This means having the same labels and using the
same number of columns and rows and cell locations for the
same types of data. This is not mandatory, but it can make the
consolidation process a lot easier.

This Excel screen shows three open workbooks, Book1, Book2,


and Book3. Book1 and Book2 need to be consolidated into
Book3.

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 111


Lesson 4: Outlining, Subtotals, and Consolidation

Consolidating To Consolidate Workbooks


Workbooks, › Select cell B2 in Book3 (the book with the empty cells)
continued and click the [Consolidate] button on the Data Tab.
This will display the Consolidate dialog.

› In the Function: field, there is a drop-down list


containing many functions you can use to combine the
data. In this example the default Sum is used.
› Under the Reference: field, enter the ranges of data to
be consolidated. The simplest most accurate way to do
this is by selecting them from the different workbooks
with your mouse or keyboard. When a range is
entered, click the [Add] button to add it to the All
References: field.

Page 112 Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation

Consolidating › Check the Use labels in boxes to consolidate sheets


based on row labels or column labels. This means,
Workbooks, the data in columns or rows that have the same labels
continued will be consolidated even if the labels are under
different column letters or row numbers in the source
workbooks. You may find consolidation is easier when
all the worksheets involved have the same labels and
layout.
› Check the Create links to source data check box. When
checked, the information in the destination work
book will be updated if the cell content in the source
workbooks is changed.
› Once all options are set, make sure the workbooks and
cell ranges to be consolidated are correct, and click
[OK].
The workbooks will be consolidated and combined into the
destination workbook (Book3 in this example). Since these files
are now also linked the data is set up in an Subtotals style.

Excel 2019: Level 3, Rel. .0, 11/11/2019 Page 113


Action 4.4 – Consolidating Workbooks

Instructions: Results/ Comments:


1. Double click any tab in the ribbon. This will hide the ribbon.

2. Open the following files from the lessons You will be consolidating each city file into
folder: one regional summary.
Report.xlsx
Columbus.xlsx
Dayton.xlsx
Detroit.xlsx

3. Save Report.xlsx as MyReport. [F12].

4. Click the View Tab, in the Window The Arrange Windows dialog opens.
Group, click the [Arrange All]. button.

5. Make sure the Windows of active This tiles the workbooks so that you can
workbook checkbox is not checked, and see them all at the same time.
click [OK].

6. Activate the Regional Summary sheet in This will be where the consolidated data
the Report file and click into cell A1. will be placed.

7. Click the Data Tab, in the Data Tools The Consolidate dialog opens.
Group, click the [Consolidate] button.

8. In the Consolidate dialog, click into the


Reference: text box.

9. Select A3:E7 in the Dayton file.

10. Click [Add]. The referenced cell range is added in the


All references: field.

11. With the Reference: field active click the


Columbus file and select cells A3:E7.

12. Click [Add].

13. Repeat the steps above to add the same


range from the Detroit.xlsx workbook.

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 114
Action 4.4 – Consolidating Workbooks, continued

Instructions: Results/ Comments:


14. Click the checkboxes for Use labels in The first row and columns of the selected
Top row and Left column. reference ranges will be treated as labels.

15. Click the checkbox to Create links to This will dynamically connect the source
source data. files to the consolidated data.

16. Click [OK]. Notice that when the data is consolidated


outlining tools are automatically added.

17. Click the [Expand] button to the left Widen the columns if necessary to see all
of Week1 to show the detail for the the data source information.
summary data.

18. Save and close the files. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. .0, 11/11/2019


Lesson 4: Outlining, Subtotals, and Consolidation, Page 115
Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Lesson 5: Analytical
Tools
Lesson Overview

You will cover the following concepts in this


chapter:
› Goal Seek
› Data Tables
› Scenarios
› Solver
› Forecasting
Lesson Notes
Lesson 5:: Analytical Tools

Goal Seek Goal Seek is a useful analysis tool provided by Excel. With
Goal Seek, Excel will find a value for a specified cell that makes
a given worksheet formula equal to a value that you define. In
other words, you can set a formula to a value (goal) that you
would like to attain, and then specify one of the cells that the
formula references as a cell that Excel can adjust in order to reach
the goal.

This is a great tool for financial calculations where you want to


meet a specific goal.

To use Goal Seek


› Select the cell containing a formula whose result you
want to define.
› Select the Data Tab.
› Click the [What-If Analysis] button drop-down in the
Forecast Group.

› From the menu choose Goal Seek.

› The Goal Seek dialog is displayed.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 119


Lesson 5:: Analytical Tools

Goal Seek, › The active cell shows in the Set cell: field.
continued › If that isn't the cell where the goal will be displayed,
change it.
› In the To Value: field, type the goal you want to get to.
› In the By changing cell: field, type the cell reference that
needs to change in order to calculate the answer.
› Click [OK].
› The Goal Seek Status dialog is displayed and reports
that a solution has been found. The cells in the
spreadsheet have changed to solve the problem.

› Clicking the [Cancel] button restores the original


worksheet values.
› Clicking the [OK] button will enter the Goal Seek
solution values into the worksheet.

Page 120 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 5.1 - Using The Goal Seek

Instructions: Results/ Comments:


1. Open the LoanSchedule.xlsx file. The file is in the lessons folder.

2. Save the file as MyLoanSchedule.xlsx. [F12].

3. Select cell D4 on the Loan Seek This cell contains a payment function
worksheet and examine the formula in formula that uses cell B5 for the interest
the Formula Bar. rate divided by 12 (this value must be
divided by 12 since this calculates monthly
payments); cell B4 defines the number of
payments (if this value was in year then
the value would have to be multiplied by
12); the -B3 is a negative value since this is
money which is owed.

4. On the Data Tab, in the Forecast Group, The What-If analysis options are
click the [What-If Analysis] drop-down displayed.
button.

5. Choose Goal Seek for the options in the


menu. The Goal Seek dialog opens.

6. In the Goal Seek dialog, the Set cell: field


make sure the cell reference is D4. This cell must contain the formula which a
If it is not then click into the Set cell: field specific return is desired.
and click cell D4.

7. In the To value: field type in;


<500>. This is the desired value.

8. Click into the By change cell: field and


select cell B4. This is the part of the formula which can
be modified to return the desired value.
9. Click the [OK] button.
The Goal Seek Status dialog opens, offering
the choice of keeping the new or original
value.
10. Click the [Cancel] button.
The original values are restored to cell D4.
11. Reselect cell D4.
If necessary.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 121
Action 5.1 - Using The Goal Seek, continued

Instructions: Results/ Comments:


12. On the Data Tab, in the Forecast Group, You will run the Goal Seek feature again to
click the [What-If Analysis] drop-down calculate how many months it will take to
button. pay off the loan.

13. Choose Goal Seek for the options in the The Goal Seek dialog opens.
menu.

14. In the Goal Seek dialog, in the Set cell:


field, make sure the cell reference is D4.

15. In the To value: field type in;


<550>.

16. Click into the By change cell: field and


select cell B4.

17. Click the [OK] button. The Goal Seek Status dialog opens.

18. Click the [OK] button. The value in the cell B4 is updated to
reflect the results of the Goal Seek.

19. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 122
Lesson 5:: Analytical Tools

Data Tables While the Goal Seek is good for looking at a single variation the
Data Table is a more useful tool for seeing a wider set of variables
in relation to a PMT function. Data Tables are a range of cells
showing the results of substituted values of a formula. They are
used in situations where you want to perform "what-if" analysis
to see how changing certain values in your formulas effects the
results of the formulas. By using Data Tables you can calculate all
of the variations in one operation which will save many hours of
work.

Excel offers two types of data tables: one-input tables and two-
input tables.

Creating a One-Input Data Table:


The function
should use › You will need to set up a worksheet with input values
cell addresses that will be substituted in for the value in the input cell.
instead of static
values. › You will need an input cell.
› You will need the formula that refers to the input cell
in the row above the first input value and one cell to
the right of the column of input values.
Input Values

Formula
› Select the range beginning with the cell above the
input values through the cell to the right of the last
input value.
› Select the Data Tab.
› In the Forecast Group, click on the [What-If Analysis]
button drop-down.
› Select Data Table from the menu.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 123


Lesson 5:: Analytical Tools

Data Tables, › The Data Table dialog opens.


continued

› Depending on the structure of the table being built


enter the variable cell in the formula into either the
Row or Column input Cell: field.
› Use the Row input cell: field if the data table is set
up to run across multiple columns.

› Use the Column input cell: field if the data table is


set up to run down a series of rows.

› Click [OK]. Excel substitutes the value in the input cell


with the values in the input value column and places
the table formula in the column below the beginning
formula.

Page 124 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 5.2 - Adding One Input Data Tables

Instructions: Results/ Comments:


1. The MyLoanSchedule.xlsx. file should If not, reopen the file.
still be open.

2. Make the Loan Tables worksheet active. Click the Loan Tables worksheet tab.

3. Select cells B11:K12. This cell range is where you will create a
row one input data table.

4. On the Data Tab, in the Forecast Group,


click the [What-If analysis] drop-down
button.

5. Choose Data Table from the menu. The Data Table dialog opens.

6. Click in the Row input cell: field and the Since the selected cell range has a range of
click in cell B5. variable interest rates running across one
row, you will use the Row input cell: field
in this example.

7. Click the [OK] button. The monthly payments are calculated


according to the variable interest rates in
cells C11:K11.

8. Select cell B15:C31. This cell range is where you will create a
column one input data table.

9. On the Data Tab, in the Forecast Group,


click the [What-If analysis] drop-down
button.

10. Choose Data Table from the menu. The Data Table dialog opens.

11. Click in the Column input cell: field and Since the selected cell range has a range of
the click in cell B4. variable interest rates running down one
column, you will use the Column input
cell: field in this example.

12. Click the [OK] button. The monthly payments are calculated
according to the variable number of
months in cells B16:B31.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 125
Action 5.2 - Adding One Input Data Tables, continued

Instructions: Results/ Comments:


13. Save the file. [Ctrl+S].

14. Make the SimpleMathTable worksheet This worksheet will be used to convert
active. one currency into another using a simple
formula with cell references.

15. Select cell C5.

16. Examine the formula in C5. This cell has simple formula to convert the
current amount to another amount based
on currency conversion values.

17. Select cells C4:I5. This is where the data table will be
created.

18. On the Data Tab, in the Forecast Group,


click the [What-If analysis] drop-down
button..

19. Choose Data Table from the menu. The Data Table dialog opens.

20. Click in the Row input cell: field and the This cell represents the exchange rates in
click in cell C2. cells D4:I4.

21. Click the [OK] button. The conversion rates are calculated
according to the variable interest rates in
cells D4:I4.

22. Save the file. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 126
Lesson 5:: Analytical Tools

Data Tables, Two-Input Data Table


continued The two-input data table is used to see how changes in two
variables affect one formula. The process works the same as the
one-input tables except you will have both a column input cell
and a row input cell.

Creating a Two-Input Data Table:


The function › You will need to set up a worksheet with input values
should use that will be substituted in for the value in the input
cell addresses cells. In this example, you will see how your monthly
instead of static payment changes based on both the interest rate and
values.
the term of the loan.
Variable interest values to replace the Rate
PMT function value in PMT function

Variable
months
values to
replace the

term value
in PMT
function

› The formula needs to be placed right above and to the


left of the input values.
› Select the table range beginning with the formula and
ending with the last input value intersection.
› Select the Data Tab.
› Click on the [What-If Analysis] button drop-down in
the Forecast Group.
› Select Data Table from the menu.
› The Data Table dialog box opens.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 127


Lesson 5:: Analytical Tools

Data Tables, › The Row input cell: field will be the Rate cell reference
continued in the PMT formula.
› The Column input cell: field should be the Term cell
reference in the PMT formula.
› Click [OK].

Page 128 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 5.3 - Adding s Two Input Data Table

Instructions: Results/ Comments:


1. The MyLoanSchedule.xlsx. file should If not, reopen the file.
still be open.

2. Make the Loan Tables worksheet active.

3. Select cells G15:P31. These cells will be used to create the two
input data table showing how changes in
the interest rate and length of the loan will
affect the monthly payments.

4. On the Data Tab, in the Forecast Group,


click the [What-If analysis] drop-down
button.

5. Choose Data Table from the menu. The Data Table dialog opens.

6. Click in the Row input cell: field and the This will define the interest rate variables.
click in cell B5.

7. Click in the Column input cell: field and This will define the number of months to
the click in cell B4. repay the loan.

8. Click the [OK] button. The data table is created.

9. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 129
Lesson 5:: Analytical Tools

Scenarios When there is a worksheet detailing a current situation and


you need to see how certain changes will affect the calculations
the Scenario feature in Excel offers the ability to see those
changes within the same worksheet, instead of creating multiple
worksheets or workbooks to see how results change. This feature
allows you define what cells will change and set the values of
those changes manually, as each set of changes are made you can
save each Scenario. You can then switch between the Scenarios to
display the saved Scenario set of variables.

It is a good Adding Scenario's


idea to create
the first Scenario In this example, you will be showing three locations rental costs.
based on the current
set of values, so you › Click the Data Tab.
can always return to it
if needed. › Click the [What-If analysis] button drop-down in the
Forecast Group.

› Choose Scenario Manager from the menu.


› The Scenario Manager dialog opens.

Page 130 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools

Scenarios, › There will be no existing Scenarios when beginning


continued this process
› Click the [Add] button
› The Add Scenario dialog opens.

› The Scenario Name: field allows you to name the


Scenario.
› The Change cells: field allows you to define what
cells values can be modified.
› The Comment: field allows you to add a brief
description of what the Scenario represents.
› After applying a name and defining the cells to be
changed click the [OK] button.
› The Scenario Values dialog opens.
› Change the values to coincide with the new data
points for the variable cells defined in the Change
cells: field.

› For the first Scenario, leave the original values in


place.
› Click the [OK] button to return to the Scenario Manager
dialog.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 131


Lesson 5:: Analytical Tools

Scenarios, › Repeat these steps to create a second Scenario when


continued the values are modified in the Scenario Values dialog.
› Add as many Scenarios as needed to avoid having
multiple worksheets with slight variations.

Showing Scenarios
› Click the Data Tab.
› Click the [What-If analysis] button drop-down in the
Forecast Group.
› Choose Scenario Manager from the menu.
› The Scenario Manager dialog opens, any existing
Scenarios are displayed in the Scenarios: field.

› Select the desired Scenario and click the [Show] button


to display that Scenario's set of values.

Page 132 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 5.4 - Creating Scenarios

Instructions: Results/ Comments:


1. Open the RentCalculation.xlsx file. It is located in the lessons folder.

2. Save the file as NewRentCalculations. [F12].


xlsx.

3. Activate the Manual Scenario worksheet. Click the Manual Scenario worksheet tab
if necessary.

4. On the Data Tab, in the Forecast Group,


click the [What-If analysis] drop-down
button.

5. Select Scenario Manager from the menu. The Scenario Manager dialog opens. This
file has no scenarios yet so none are listed.

6. Click the [Add] button. To create the first scenario. The Add
Scenario dialog opens.

7. Click into the Scenario name: field and This will be the name of the scenario when
type in; complete.
<Original>.

8. Click into the Changing cells: field and This are the cells that can be altered in this
then select cells B7:C7 hold the [Ctrl] key and other scenarios to allow changes.
and click cell G7.

9. In the Comment: field type in; This is not required but never hurts to see
<These are the current figures>." the comments to know which scenario you
will choose to show later on.

10. Click the [OK] button. The Edit Scenario dialog opens, showing
the cells that can be changed along with
the values in those cells.

11. Leave the values as they are and click the Since this is the original scenario, no
[OK] button. changes should be made. The Scenario
Manger dialog is re-displayed.

12. Click the [Add] button. The Add Scenario dialog opens again.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 133
Action 5.4 - Creating Scenarios, continued

Instructions: Results/ Comments:


13. Click into the Scenario name: field and This will be the name of the second set of
type in; variables in the scenario.
"Second Location"

14. In the Comment field type in;


"These are the figures at second
location"
The Edit Scenario dialog opens again.
15. Click the [OK] button.
The values represent the changes in
16. Enter the following values; cost per square foot, footage, and the
1: "15" Maintenance Fees. Click into the first field
2: "7500" and use the TAB key to move to the next
3: "500" field after entering the new values. The
Click the [OK] button. Scenario Manager dialog is re-displayed.

17. Try adding another Scenario choosing Name this Scenario 'Third Location".
your own values.

18. Close the Scenario Manager dialog.

19. On the Data Tab, in the Forecast Group,


click the [What-If analysis] button drop-
down.

20. Select Scenario Manager from the menu. The Scenario Manager is displayed,
showing the saved Scenarios.

21. Choose the Second Location scenario and The values change in accordance to the
click the [Show] button. Scenario being shown.

22. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 134
Lesson 5:: Analytical Tools

Scenarios, Editing a Scenario


continued When the set of variables changes you may need to update the
scenario to reflect those changes. Any Scenario can be edited
from within the Scenario Manage dialog.

› Open the Scenario Manager from the [What-If analysis]


button drop-down.
› Select the Scenario that needs to be updated.
› Click the [Edit] button to open the Edit Scenario dialog.

› Click the [OK] button to open the Scenario Values


dialog.

› Change the values as needed and click the[OK] button.


› Click the [Close] button to close the Scenario Manager
dialog.

Removing Scenarios
› Open the Scenario Manager dialog.
› Select the unwanted Scenario.
› Click the [Delete] button
› Click the [Close] button to close the Scenario Manager
dialog.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 135


Action 5.5 - Editing and Deleting a Scenario

Instructions: Results/ Comments:


1. The NewRentCalculations.xlsx. file If not, reopen the file.
should still be open.

2. On the Data Tab, in the Forecast Group,


click the [What-If analysis] button drop-
down.

3. Select Scenario Manager from the menu. The Scenario Manager dialog opens.

4. Select the Third Location Scenario and The Edit Scenario dialog opens.
click the [Edit] button.

5. Click the [OK] button. The Scenario Values dialog opens.

6. Change the values in the Scenario Values


dialog.

7. Click the [OK] button. The Scenario Manager dialog is re-


displayed.

8. Select the Third Location Scenario and The Third Location Scenario values are
click the [Show] button. shown in the worksheet.

9. On the Data Tab, in the Forecast Group,


click the [What-If analysis] button drop-
down.

10. Select Scenario Manager from the menu. The Scenario Manager dialog opens.

11. Select the Third Location Scenario and The Third Location Scenario is removed
click the [Delete] button. from the list of available Scenarios.

12. Click the [Close] button. The Scenario Manager dialog closes.

13. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 136
Lesson 5:: Analytical Tools

Solver The Solver is an Excel add-in program, used for what-if analysis.
When you need to calculate to an optimal (maximum or
minimum) value for a formula in one cell use the Solver to find
the desired value. This is similar to the Goal Seek but offers
new levels of control by allowing you to set constraints to the
variables used to determine the desired value. Solver adjusts the
values in the variable cells in accordance with the limits defined
by constraints in order to meet the desired result.

The Solver must be enabled from the Excel Add-ins before you
can access it.

Installing the Solver Add-in


If the Solver does › Display the File Menu and click the Excel Options
not install properly, button on the left side of the Backstage view.
check to see if the
ActiveX settings have › The Excel Options dialog is displayed,
been set to Prompt me.
› Choose the Add-Ins category from the left side of the
To access the ActiveX
setting; go to the File window.
Tab, choose Excel
› From the drop list at the bottom specify Excel Add-ins
Options, choose Trust
Center, click the [Trust (if not already designated).
Center Settings] button,
› Click [Go] to display the Excel Add-ins dialog.
choose ActiveX Settings,
click the Prompt me radio
button and click the [OK]
buttons to exit all options
windows. You may need
to restart Excel for all
changes to take effect.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 137


Lesson 5:: Analytical Tools

Solver, › The Add-ins dialog opens.


continued

› Put a check next to the Solver Add-in option in the


available add-ins list.
› Click [OK].
› When Excel finishes installing the Solver, an Analysis
Group is added at the right side of the Data Tab, with
the [Solver] button.

Page 138 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools

Solver, Using Solver


continued If the worksheet you are using has formulas that are feeding into
an overall value, then the solver can be used to help reach an
objective by adjusting the cell values used by those formulas. It is
also possible to add cells to define parameters to be considered in
the Solver's recalculations, although it is not necessary.

In the example being used here, we will be trying to find the best
options in order to reduce rental costs while working within q set
of constraints.

› Once the spreadsheet is set up,


› click the [Solver] button in Analysis Group on the
Data Tab.

› The Solver Parameters dialog is displayed.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 139


Lesson 5:: Analytical Tools

Solver, › Click into the Set objective: field and select the cell
continued containing the final output formula.
› Set the To: radio buttons to the desired objective.
› Max- will return the highest value
› Min- will return the lowest value
› Value of- allows you to define a specific value.
› The By Changing Variable Cells: field, allows you to
select which cells can be modified in order to return
the desired value.
› The Subject to the Constraints: field is empty at first.
When there are limits or constraints you need to add to
the Solver click the [Add] button.
› The Add Constraint dialog opens.

› The Cell Reference: field is where you choose the


cell that can be modified.
› The Operator drop-down allows you to select from
a set of options: Less than or equal to, Greater than
or equal to, equal to, Integer, Bin, or Dif.
› The Constraint: field allows you to either choose a
cell or enter a specific value.
› Click the [Add] to continue adding other
constraints.
› Click the [OK] button when all the constraints have
been added.

Page 140 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools

Solver, › Click the [Solve] button. The Solver runs the


continued calculations and the Solver Results dialog opens.

› In this dialog you can choose to:


If you checked › Keep Solver Solution.
the Return to
Solver Parameters › Restore Original Values.
Dialog checkbox the
› Return to Solver Parameters Dialog.
Solver dialog reopens.
› You are also able to Save the Solver results as a new
Scenario.
› Select the options you wish to use and click the [OK]
button.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 141


Action 5.6 - Adding the Solver to Excel

Instructions: Results/ Comments:


1. Click the File Tab. The Backstage view is displayed.

2. Select Options from the right side of the The Options dialog opens. You could also
Backstage view. use the ALT F T sequential keyboard short
cut.

3. On the left side of the window click the The Add-ins set of options are displayed in
Add-ins category. the main screen area.

4. In the Manage: drop-down make sure This should be the default selection, if not
that Excel Add-ins is selected and click the then use the drop-down and select it. The
[Go] button. Add-ins dialog opens.

5. In the Add-ins dialog check the Solver This is the specific Add-in you are adding
Add-in checkbox to Excel.

6. Click the [OK] button. Excel adds the Solver.

7. Make the Data Tab active.

8. Notice the new Analysis Group on the The Analysis Group gives access to the
right side of the Data Tab. Solver tool.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 142
Action 5.7 - Using the Solver

Instructions: Results/ Comments:


1. NewRentCalculations.xlsx file should If not, reopen it.
still be open.

2. Make the Solver Scenario worksheet Click the Solver Scenario worksheet tab.
active.

3. On the Data Tab, in the Forecast Group,


click the [What-If analysis] button drop-
down.

4. Select Scenario Manager from the menu. The Scenario Manager dialog opens.

5. Click the [Add] button. To create the first scenario. The Add
Scenario dialog opens.

6. Click into the Scenario name: field and This will be the name of the scenario when
type in; complete.
<Original>

7. Click into the Changing cells: field and This are the cells that can be altered in this
then select cells B7:C7 hold the [Ctrl] key and other scenarios to allow changes.
and click on cells E7 and G7.

8. Click the [OK] button. The Set Values dialog opens.

9. Leave the values as they are and click the The Scenario Manager dialog is re-
[OK] button. displayed.

10. Click the [Close] button. The Scenario Manager dialog closes.

11. On the Data Tab, click the [Solver] The Solver Parameters dialog opens.
button drop-down in the Analysis
Group.

12. Click into the Set objective: field and This cell contains the formula used to
then select cell B1. return the monthly rental of an office
space.

13. Click the Value of: radio button and This represents the desired target value, by
enter < 7000 > in the Value field. choosing a target value the solver acts very
much like the Goal Seek.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 143
Action 5.7 - Using the Solver, continued

Instructions: Results/ Comments:


14. Click into the By Changing Variable These cells are used in the calculations
Cells: field and select cells B7:C7, E7,G7. to determine the value in cell B1. Setting
these as variable cells will allow Solver to
modify their values in order to return the
desired value in B1.

15. Click the [Add] button in the Subject to The Add Constraint dialog opens, where
the Constraints: area of the dialog. limits to the modifications Solver can make
in the variable cells.

16. In the Cell Reference: field enter B7, This will define the top amount to be paid
Set the Operator to <=, per square foot. Clicking the [Add] button
in the Constraint: field enter B16, will add the constraint and clear the field
then click the [Add] button. so you can add the next constraint.

17. In the Cell Reference: field enter B7, This defines the lowest amount to be paid
Set the Operator to >=, per square foot.
in the Constraint: field enter B17,
then click the [Add] button.

18. In the Cell Reference: field enter C7, This defines the largest size of the space.
Set the Operator to <=,
in the Constraint: field enter B11,
then click the [Add] button.

19. In the Cell Reference: field enter C7, This defines the smallest size of the space.
Set the Operator to =>,
in the Constraint: field enter B12,
then click the [Add] button.

20. In the Cell Reference: field enter E7, This sets the maximum number of rooms
Set the Operator to <=, the space should have.
in the Constraint: field enter B13,
then click the [Add] button.

21. In the Cell Reference: field enter E7, This sets the minimum number of rooms
Set the Operator to >=, the space should have.
in the Constraint: field enter B14,
then click the [Add] button.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 144
Action 5.7 - Using the Solver, continued

Instructions: Results/ Comments:


22. In the Cell Reference: field enter E7, This defines the value in cell E7 must be a
Set the Operator to int, whole number.
then click the [Add] button.

23. In the Cell Reference: field enter G7, This sets an exact amount for the
Set the Operator to =, maintenance fees. Since you are done
in the Constraint: field enter <500>, adding all the constraints, clicking the
then click the [OK] button. [OK] button returns you to the Solver
Parameters dialog.
24. Examine the constraints now listed in the
Subject to the Constraints: field.

25. Click the [Solve] button. The Solver Results dialog opens.

26. In the Solver Results dialog check the The Save Scenario dialog opens.
Return to Solver Parameters Dialog
checkbox and click the [Save Scenario]
button.

27. In the Save Scenario dialog, click into the The Scenario is named and saved, the
Scenario Name: field and enter Solver Results dialog is re-displayed.
"7000 target" and click the [OK] button.

28. Click the Restore Original Values radio By choosing this radio button option the
button and then click the [OK] button. original values are put back into place and
the Solver Parameters dialog is re-displayed.

29. Select the $G$7=500 constraint and click The Change Constraint dialog opens.
the [Change] button.

30. Change the value in the Constraint: The constraint has been edited and the
field from 500 to 400 and click the [OK] Solver Parameters dialog is re-displayed.
button.

31. Click the [Solve] button. The Solver Results dialog is displayed.

32. Click the [Save Scenario] button. The Save Scenario dialog opens.

33. In the Save Scenario dialog, click into the A third scenario is saved and the Solver
Scenario Name: field and enter Results dialog is re-displayed.
< 7000 target 2 > and click the [OK]
button.
Excel 2019: Level 3, Rel. 1.0, 11/11/2019
Lesson 5:: Analytical Tools, Page 145
Action 5.7 - Using the Solver, continued

Instructions: Results/ Comments:


The original values are put back into place
34. Click the Restore Original Values radio and the Solver Parameters dialog is re-
button and then click the [OK] button. displayed.

The Solver Parameters dialog is closed.


35. Click the [Close] button.

36. On the Data Tab, click the [What-If


analysis] button drop-down in the
Forecast Group.
The Scenario Manager dialog opens,
37. Select Scenario Manager from the menu. showing the three scenarios created.

The values for this scenario are displayed


38. Select the 7000 target 2 Scenario and click on the worksheet.
the [Show] button.
Depending on the scenario being shown,
39. Try changing which scenario is being the values change.
shown and the click the [Close] button.
[Ctrl+S] and [Ctrl+W].
40. Save and close the file.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 146
Lesson 5:: Analytical Tools

Forecasting When the data you are working with has historical time-based
data, Excel can be used to create forecasts without having to
generate a chart. Creating a forecast will add a new worksheet
containing a table of the existing data and predicted values along
with a chart of the table data. Forecasts help predict future trends
based on the existing data.
The timeline
requires
The structure of the data can be either vertically or horizontally
consistent
intervals between its laid out when using the Forecast feature. As long as one column
data points. or row has time based data, you are able to create and forecast
the data as far into the future as needed. When creating the
Forecast you can choose from either a Line or Bar chart.

Create a Simple Forecast


› Click any cell within the data set. ( If you choose
a single cell, Excel will automatically expand the
selection to include all the connected data when using
the Forecast feature.)
- OR -
› Select both data series to be forecasted. (Include the
timeline date in the selection.)
› On the Data tab, in the Forecast Group, click the
[Forecast Sheet] button.

› The Create Forecast Worksheet dialog opens.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 147


Lesson 5:: Analytical Tools

Forecasting, › Choose either a line or column chart in the upper


continued right corner of the Create Forecast Worksheet dialog
as the visual representation.

› Click into the Forecast End: field use the Date


Picker to set the end date of the forecast.

› Click the [Create] button to generate the new


worksheet with the forecast table and chart..

Customizing the Forecast


› While in the Create Forecast Worksheet dialog, click the
Option drop-down to expand the options available
with forecasting.

Page 148 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools

Forecasting, › The Forecast Start: field allows you to set the date
continued when the forecast is to begin. If you set the date prior
to the end of the historical data only data prior to the
start date in the prediction is calculated.
› The Confidence Interval checkbox shows or hides the
confidence interval. The forecasted values should be
within the range set in the Confidence Interval: field.
Note: The default value is 95%
If your data
is seasonal,
then starting
a forecast before the Confidence
last historical point is Intervals
recommended.

› Seasonality allows you to set the length (number of


points) for a seasonal pattern. Detect Automatically
is the default but you can select Manually to set the
pattern to suit your needs.
› The Timeline Range: field allows you to define the
cells containing the date or time data in the data set.
› The Values Range: field allows you to choose which
cells contain the values used to create the forecast. This
should match the Timeline Range in scope.
› The Fill Missing Points Using: drop-down uses
interpolation by default but allows you to choose
Zeros or:
› Interpolation means that any missing point will be
calculated as a weighted average of the neighboring
points.
› Zeros will place a zero value for any missing
points.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page 149


Lesson 5:: Analytical Tools

Forecasting, › The Duplicate Aggregates Using: field drop-down


continued allows you to determine how Excel will handle
multiple values with the same timestamp. The default
is Average but you can choose other methods from the
list.
› The Include Forecast Statistics: checkbox can add a
table of statistics to the new worksheet. The table will
contain measures, such as the smoothing coefficients
(Alpha, Beta, Gamma), and error metrics (MASE,
SMAPE, MAE, RMSE).

Page 150 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action 5.8 - Adding a Forecast Worksheet

Instructions: Results/ Comments:


1. Open the Forecasting.xlsx file. It is located in the lessons folder.

2. Save the file as MyForecasting.xlsx. [F12].

3. Activate the Vertical Data worksheet. Click the Vertical Data worksheet tab if
necessary.

4. Click any cell containing a value. Excel will automatically expand the
selection when the [Forecast Worksheet]
button is clicked.

5. On the Data Tab, in the Forecast Group, The the Create Forecast Worksheet dialog
click the [Forecast Worksheet] button. opens.

6. Click the date picker for the Forecast The preview shows the forecast going
End: field and set the date to forward to June 1, 2018. As the Forecast
December 1, 2018. End is redefined the preview adapts to
show the changes.

7. Click the [Create] button. A new worksheet is added to the file with
a table and chart.

8. Select the new sheet and examine it. The table shows the total column of
the source data was used to generate
the forecast. It also shows the existing
historical data and then forecasted data
in the Forecast column, also added are
columns showing the forecasted lower and
higher values.

9. Delete the new worksheet. Right-click the new worksheet tab and
choose Delete from the menu.

10. Save the file and leave it open. [Ctrl+S].

11. Activate the Horizontal Data worksheet. Click the Horizontal Data worksheet tab.

12. Click any cell containing a value.

13. On the Data Tab, in the Forecast Group,


click the [Forecast Worksheet] button.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 151
Action 5.8 - Adding a Forecast Worksheet, continued

Instructions: Results/ Comments:


14. Click the [Create a column chart] button Excel will create a Column Chart instead of
in the upper right corner of the Create a Line Chart.
Forecast Worksheet dialog.

15. Click the [Create] button. The new worksheet with forecasting is
added to the workbook.

16. Examine the new worksheet and the This time the utilities row was used as
delete it. the data for the forecast and the chart is a
column chart.

17. Activate the Vertical Data worksheet. Click the Vertical Data worksheet tab if
necessary.

18. Click any cell containing a value.

19. On the Data Tab, in the Forecast Group, The Create Forecast Worksheet dialog opens.
click the [Forecast Worksheet] button.

20. Click the Options arrow. The Options are expanded.

21. Set the Forecast Start: field to The forecasting will start from an
June 1, 2017. overlapped position.

22. Change the Confidence Interval to 50%. The Confidence Interval lines in the
preview are brought closer together.

23. Set the Value Range: field to; Instead of forecasting the totals column
Vertical Data'!$B$5:$B$29. of data you will now be forecasting the
utilities column of data.

24. Click the [Create] button. The new worksheet is added to the
workbook.
25. Examine the new worksheet.

26. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Lesson 5:: Analytical Tools, Page 152
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Appendix A: The
Default Workbook and
Theme
Lesson Overview

You will cover the following concepts in this


chapter:

› The Default Workbook


› Excel Styles
Lesson Notes
Appendix A: The Default Workbook and Theme

The Default In addition to Themes, there are other formatting options that are
stored in their individual style galleries, which are all stored in
Workbook the default workbook. The default workbook is the template that
is used for all new workbooks.

Settings That Can Be Saved in a Template

› Cell and sheet formats.


› Page formats and print area settings for each sheet.
Check with your › Cell styles.
administrator for
permission to alter › The number of sheets in a workbook.
the default workbook.
Not all installations or › Protected and hidden areas of the workbook.
login credentials allow
access to the default › Standard text you want in every workbook, such as
workbook folder. page headers and row and column labels.
› Data, graphics, formulas, charts, and other information.
› Data validation settings.
› Macros, hyperlinks, and ActiveX controls on forms.
› Workbook calculation options and window view
options.

If you want to make the styles that you create in or copy into a
workbook available in all future workbooks, you can save them
in the default workbook.

Saving Cell Styles to the Default Workbook

› Open the workbook that contains the styles that you


want to make available.
› Open a new, blank workbook.
› In the blank workbook, click [Cell Styles] in the Styles
Group of the Home Tab.
› Click Merge Styles... at the bottom of the gallery.
› In the Merge Styles dialog box, double-click the
workbook that contains the styles that you want to
make available, and then click [OK].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page A3


Appendix A: The Default Workbook and Theme

The Default If the two workbooks contain styles with the same names, you
will see a message asking whether you want to merge these
Workbook, styles.
continued
To replace the styles in the active workbook with the copied
styles, click [Yes].

To keep the styles in the active workbook, click [No].

You receive this message only once, regardless of the number of


conflicting style names.
› On the File Tab, click Save As.
› In the File name: field, type book.
› In the Save as type: list, select Excel Template (*.xltx).
› Using the folder list and address bar, navigate to the
XLStart folder.
The XLStart folder can be located in the Microsoft Office folder:
C:\Program Files\Microsoft Office 14\root\office14
- OR -
You may also use
the Windows Search If you do not have permission to save to the Program Files folder,
function to find the you can save it to you Users folder.
XLStart folder.
For example, if your name is Ann:
C:\Users\Ann\AppData\Roaming\Microsoft\Excel\XLStart
› Click Save.
› Close and re-open Excel to see the styles added to the
default Style Gallery.

Page A4 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action A.1 - Customizing the Default Workbook

Instructions: Results/ Comments:


1. Open a new Excel workbook.

2. Click on the Windows [Start] button in


the lower left-hand corner of your screen.

3. In the Search field, type: XLStart.

4. Where is it located? Write it on the line in


the Results section. _____________________________________

5. Rename Sheet1 to Dashboard. Double-click on the sheet tab and type


Dashboard.
6. From the Insert Tab, select [Picture].

7. Browse to the student exercises file folder


and click on the TCW logo file.

8. Click [OK].

9. Move the logo so that it rests in cells There is no need to resize the logo.
A3:A6.

10. Insert a hyperlink to The Computer Right-click on the graphic and select
Workshop on the TCW logo. Hyperlink.... Then in the Address: field,
type: www.tcworkshop.com

11. On the Format Picture Tools Tab, apply Fourth from the left in the top row of the
the Drop Shadow Rectangle style from the gallery.
Picture Styles gallery.

12. Using the Developer Tab, insert a Macro Click on the [Insert] button on the
Button Form Control to print the Developer Tab. Select the Button tool
worksheet. Name the macro and the and draw a button in cells A1 and B1.
button Print Worksheet. When the Macro dialog box opens, type
PrintWorksheet in the Name: field and
click the [Record] button. Select the File
Tab, Print, and click [Print]. Click the
[Stop Recording] button on the Developer
Tab.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix A: The Default Workbook and Theme, Page A5
Action A.1 - Customizing the Default Workbook, continued

Instructions: Results/ Comments:


13. In the header of the worksheet, insert and
center The Computer Workshop.

14. In the left section of the footer, insert


Created by: <your name> .

15. Rename Sheet2 to Company

16. Delete Sheet3.

17. Click on the File Tab.

18. Select Save As.

19. Change the Save as type: to Excel Be sure to complete this step before
Template (.xltx). changing the file type. When the file
type is changed to Excel Template (.xltx),
the Save As location will default to the
Templates folder.

20. Change the File name: to book. Making the filename Book and the Save
As type: Template should create a new
default workbook template.

21. Click [Save].

22. Close your file.

23. Create a new workbook. Observe that the new workbook has the
button and logo you created.

24. Click on the File Tab and select Print. Notice the header and footer in the Print
Preview.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix A: The Default Workbook and Theme, Page A6
Appendix A: The Default Workbook and Theme

Excel Styles With the advent of Excel 2007, a new standard of formatting
was developed involving styles. All of the Office products now
incorporate Themes in formatting documents, workbooks and
presentations. A Theme is a combination of fonts, styles and
colors used in the active workbook.

When you select colors from a color palette, there is a row


of theme colors at the top of the palette. Those colors are
determined by the default workbook and can be changed in
individual workbooks or saved to the default.

The default Office Theme includes the colors you see in the
current font and fill drop-down galleries.

These are also the colors that appear in the series representation
when you create a chart.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page A7


Appendix A: The Default Workbook and Theme

Excel Styles, By using the Page Layout Tab, you can see which colors will be
continued applied, when you can view or change the current color palette,
and also view or change the Theme.

Changing the Theme of a Workbook


› On the Page Layout Tab, click the [Themes] button.
› Select from the drop-down gallery
- OR -
Select Save Current Theme to save a custom theme.

Changing the Colors in a Workbook Theme


› On the Page Layout Tab, click the [Themes] button.
› Select from the drop-down gallery
- OR -
Select Create New Theme Colors to save a custom set of
colors.
Notice you can change different elements which affect the bars in
a column chart, or the pieces in a pie chart.

Changing the Font in a Workbook Theme


› On the Page Layout Tab, click the [Fonts] button.
› Select from the drop-down gallery
- OR -
Select Create New Theme Fonts to save a custom set of
colors.

Page A8 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix A: The Default Workbook and Theme

Excel Styles, Saving a Custom Theme


continued › On the Page Layout Tab, select the [Themes] button
drop-down arrow.
› Select Save current theme... from the list.
› In the Save Current Theme dialog box, type a name for
your theme in the File name: field.
› Click the [Save] button.
Your new theme will appear in the Custom section of the
[Themes] gallery.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page A9


Action A.2 - Changing the Workbook Theme

Instructions: Results/ Comments:


1. Open the Styles.xlsx workbook. Notice the colors and font style applied to
the worksheet.

2. Save the file as My Styles

3. Click on the [Colors] button in the


Themes Group of the Page Layout Tab.

4. Select the Marquee color palette. Notice the colors changed on the Chart,
PivotTable, Slicer, and the Table.

5. Click on the [Fonts] button in the


Themes Group of the Page Layout Tab.

6. Choose the Georgia font group.

7. Click into cell E1.

8. Type: Ohio Book Sales.

9. On the Home Tab, in the Styles Group,


select Title from the Cell Styles Gallery,

10. Click on the [Colors] button in the We will use custom colors not found on
Themes Group of the Page Layout Tab. the palette.

11. Select Customize Colors.

12. In the Create New Theme Colors dialog


box, in the Name: field, type: TCW.

13. Select the drop-down arrow next to


Accent 1.

14. Click on the More Colors... option at the


bottom of the menu.

15. On the Custom tab, type:


R= 0, G= 83, and B= 134.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix A: The Default Workbook and Theme, Page A10
Action A.2 - Changing the Workbook Theme, continued

Instructions: Results/ Comments:


16. Click [OK].

17. Repeat steps 12 thru 15 for Accent


2, Accent 3 and Accent 4, with the
following attributes:
Red: Green: Blue:
Accent 2 133 197 87
Accent 3 165 165 165
Accent 4 149 79 114

18. Click [Save]. Now we will test the new colors

19. Click on the [Colors] button in the


Themes Group of the Page Layout Tab.

20. Select TCW from the Custom section of The PivotTable and PivotChart should
the list. now be formatted with the custom TCW
colors.

21. Save and close the file.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix A: The Default Workbook and Theme, Page A11
Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Appendix B: Querying
a Website with Excel
2016
Lesson Overview

You will cover the following concepts in this


chapter:
› Querying Data from a Web Site
› Editing A Query
Lesson Notes
Appendix B: Querying a Website with Excel 2016

Querying Data Excel 2016 offers a set of querying tools in the new Get &
Transform Group on the Data Tab. While the new Power Query
from a Web Site and Power Pivot tools are outside the scope of this book, we will
be examining how to use the New Query to gather information
from websites.

New Group

New Query from Web


When you want to pull information from a web page into Excel
using the New Query feature, the web page must have the data
you are looking for in a tabular format.

› Click the [New Query] button drop-down in the Get &


Transform Group on the Data Tab.
› Scroll down to the From Other Sources option.
› From the Other Sources menu choose From Web.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page B3


Appendix B: Querying a Website with Excel 2016

Querying Data › The From Web dialog opens.

from a Web Site,


continued

› Enter the web address into the URL field and click the
[OK] button.

› The Navigator dialog opens.


› In the Display Options area, a list of all the different
tables on the web page are displayed.

Page B4 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix B: Querying a Website with Excel 2016

Querying Data › These may or may not be named, depending on


how the site is using HTML labels to define the
from a Web Site, tables.
continued
› You are able to choose a single table or by checking
the Select Multiple Items checkbox select more
than one table to connect to.
› When choosing a single table, a preview is displayed
on the right side of the dialog.
› There are two options for the preview at the top of
this section of the Navigation dialog, either as Table
or Web view.

› The Table View shows the data as an unformatted


table.
› The Web View shows the table as it appears on the
web page.
› When selecting more than one table the preview
area displays the highlighted table in the Display
Options area.
› Once the tables are decided on, click the [Load] button
to load the data into a new worksheet.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page B5


Action B.1 - Gathering Data from a Web Site

Instructions: Results/ Comments:


1. Open the LinkToSite2.xlsx file. The file is in the lessons folder.

2. Save the file as CurrencyExchange.xlsx. [F12].

3. Select cell A1, and copy it. [Ctrl+C] or right click and choose Copy
from the menu.

4. Click the Data Tab, in the Get & The list of Queries are displayed.
Transform Group, click the [New
Query] drop-down button.

5. In the [New Query] drop-down, choose The From Web dialog opens.
From Web from the Other Sources
submenu.

6. Click into the URL field and paste the [Ctrl+V] or right click and choose Paste
copied link. from the menu.

7. Click the [OK] button. The Navigation dialog opens.

8. From the Display Options area select the To select the table from this web page to
Live Currency table. connect to. A preview of the data in that
table is displayed on the right side of the
Navigation dialog.

9. Click the Web View tab. The preview now shows what the table
looks like on the site.

10. Click the back to the Table View tab. The preview shows s simple table view.

11. Click the [Load] button. The data from the selected table is added
in cell A1 of a new worksheet.

12. Save the file and leave it open. [Ctrl+S].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix B: Querying a Website with Excel 2016, Page B6
Appendix B: Querying a Website with Excel 2016

Editing A Query Removing Unnecessary Data from a Query


Once the data connection is established and the data added on a
worksheet in the workbook, you may realize there is unnecessary
data in the table. When the data table is selected, or any cell
within the table the Query Tab is displayed on the ribbon.

This tab is
a contextual
tab and is only
displayed when the
table or a cell within
the table is actively
selected.
Editing the Table
› Click the [Edit] button in the Edit Group on the Query
Tab.
› The (Table Name) Edit Query dialog opens.

› Select any column that is not needed by clicking the


column header.
› Click the [Remove Columns] button in the Manage
Columns Group on the Home Tab in the Query Editor
dialog.
› You can also choose specific rows of data to keep
from the table by using the [Reduce Rows] button
drop-down.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page B7


Appendix B: Querying a Website with Excel 2016

Editing A Query, › As changes are made a list of those change are


continued displayed in the Query Setting pane of the editor.

› To Undo any change: select the change and click


the [X] button to remove the specific change.

› To see how the changes will affect the table click the
[Refresh Preview] button in the Query Group on the
Home Tab of the Query Editor dialog.
› When all changes are completed, click the [Close &
Load] button in the Close Group on the Home Tab of
the Query Editor dialog.

Page B8 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix B: Querying a Website with Excel 2016

Editing A Query, Splitting a Column


continued › Select the column to split into multiple columns.
› Click the [Split Columns] button drop-down, two
options are available: .

› Delimiter- choose this option if there is a common


character that can be used as a marker of where the
data can be split. (This is the choice for the example
used here.)
› By Number of Characters- choose this option if
there is a common prefix that can be used as a
marker to define where the data is to be split.
› If the Delimit option is chosen, the Split Column by
Delimiter dialog opens.

› The Select or enter delimiter field drop-down


offers a variety of common characters to choose
from, including Custom.
› Choosing Custom from the list of delimiters adds a
field where you can enter the character to use as the
delimiter.
› Click the Advanced Options drop-down to expand
more options on how the data will be split.
› Click the [OK] button when done to apply the changes.
› Click the [Close & Load] button to finish editing the
query.

Refreshing the Data


Click the [Refresh] button in the Load Group on the Query Tab.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page B9


Action B.2 - Editing the Query

Instructions: Results/ Comments:


1. The CurrencyExchange.xlsx file should If not, then re-open the file.
still be open.

2. Click any cell in the data table that was To make the data table active and display
just added to the workbook. the Query Tab in the ribbon.

3. Activate the Query Tab in the ribbon.

4. In the Edit Group, click the [Edit Query] The Query Editor dialog opens.
button.

5. Select the third column header in the The column is highlighted.


preview.

6. In the Manage Columns Group, click the The column is removed.


[Remove Columns] button.

7. Click the first column header in the This column will be split into two separate
preview. columns.

8. In the Transform Group, click the [Split The Split Column by Delimiter dialog opens.
Columns] button drop-down and choose
the By Delimiter option.

9. Choose Custom from the Select or enter A new blank field is added below the
delimiter field drop-down. Select or enter delimiter filed.

10. Click into the new field and type in: This character is used to divide the two
< / >. currencies in the column and will now be
used as the marker for spliting the column
into two.

11. Click the Advanced options arrow. New options relating to how the columns
can be split are displayed.
12. Examine the available options.

13. Click the Advanced options arrow. The advanced options are collapsed.

14. In the Applied Step field of the Query The Split Columns action is undone and
Settings pane, select the Split Columns by the column is recombined. You may need
Delimiter step and click the [X] button. to remove the Changed Type 1 step before
the Split Columns by Delimiter.
Excel 2019: Level 3, Rel. 1.0, 11/11/2019
Appendix B: Querying a Website with Excel 2016, Page B10
Action 3.7 - Editing the Query, continued

Instructions: Results/ Comments:


15. On the Home Tab, click the [Close & The Query Editor dialog is closed and the
Load] button. data table updated.

16. Click the [Refresh] button in the Load The data in the table is updated based on
Group on the Query Tab. the information from the web site.

17. Save and close the file. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix B: Querying a Website with Excel 2016, Page B11
Tips and Notes
Excel 2019: Level 3
Rel. 1.0, 11/11/2019

Appendix C:
2016-Sharing and
Linking Workbooks
Lesson Overview

You will cover the following concepts in this


chapter:
› Creating and Using Shared Workbooks
› Sharing a Workbook
› Tracking Changes
› Protecting a Shared Workbook
› Resolving Conflicts in a Shared
Workbook
› Consolidating Workbooks
Lesson Notes
Appendix C: Sharing and Linking Workbooks

Shared Excel’s shared workbook feature allows multiple users to edit


a single workbook at the same time. Moreover, the users that
Workbooks are modifying the shared workbook can be at separate remote
locations. This is a great way for coworkers to overcome location
or scheduling barriers that prevent them from meeting. All of the
users can collaborate on the worksheet from their own desks at
the same time or at different times, and the changes made can be
reviewed and merged when required.

In this lesson, you will learn how to share an Excel workbook,


how to track changes to the workbook, how to resolve conflicts in
a shared workbook, and how to revise a shared workbook.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C3


Appendix C: Sharing and Linking Workbooks

Sharing a Sharing Limitations


Workbook There are some Excel features and objects that cannot be modified
once a workbook is shared. It is usually a good idea to set up
these features as needed before you share the workbook.
The following features and objects can be viewed but not
modified in a shared workbook.
› Drawing objects
› Data validation
› Charts
› Conditional formatting
› Hyperlinks
› Merged cells
› Groupings and outlines
› Array formulas
› Pictures
The following features and objects can be viewed, but cannot be
created or modified in a shared workbook.
› Data tables
› PivotTable reports
› Sparklines
› Slicers
› Excel tables
› Data forms
In addition, passwords, scenarios, and lists cannot be viewed or
created in a shared workbook.

You can run existing macros and you can record shared
workbook operations into a macro stored in another unshared
workbook. However, you cannot, write, record, change, view or
assign macros.

Also, you cannot sort or filter by formatting, use the Text to


Columns command, work with XML data, or delete worksheets
or blocks of cells in a shared workbook.

Page C4 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks

Sharing a How to Share a Workbook


Workbook, Once you have created your workbook, the most efficient way
to share it is to save the workbook to a shared network folder or
continued
location.
› Use the Save As dialog to browse to the shared folder
on your network and click the [Save] button in the
dialog to save the workbook.

For this example, the workbook will be saved as


SharedWorkbook2.

› Click the [Share Workbook] button in the Changes


Group on the Review Tab.

› This will display the following Share Workbook dialog.

› Put a checkmark in the checkbox on the Editing Tab


to allow more than one user to make changes to the
workbook simultaneously.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C5


Appendix C: Sharing and Linking Workbooks

Sharing a › Click the Advanced Tab in the Share Workbook dialog


to show you more options for configuring your shared
Workbook, workbook.
continued

On this tab, you can specify how many days to keep track of
changes to the workbook, when to update changes, and how to
resolve conflicts.

› Under the Track Changes heading, you will see an


option button labeled Keep change history for. Selecting
this button will allow you to review the changes made
to the shared workbook by the users involved. You
should keep in mind that if you specify a long period
of time to keep the change history, the file size can
grow quite large if there are frequent changes.

Page C6 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks

Sharing a › Under the Update Changes, heading you can choose to


have changes to the file updated when the file is saved,
Workbook, or automatically, based on a time period that you
continued specify. If changes are updated automatically, your
shared workbook will be updated for you even while
you have it open. If you select the When file is saved
option, saving the shared workbook will update all of
the changes made since the last time you saved it.
› When a workbook is shared, it is possible for more
than one user to modify the workbook at the same
time. If two people try to save a shared workbook after
making changes to the same cells, a conflict can occur.
You can use the Conflicting changes between users
section to moderate how to resolve this issue.
› Click the [OK] button in the Share Workbook dialog to
save the shared workbook to a shared network folder
if you have not already done so.
If you have saved the workbook to a shared network folder before
making it a shared workbook (as is the case in this example),
you will see the following alert when you click [OK] in the Share
Workbook dialog.

If you click [OK], the workbook will be saved as a shared


workbook. The shared workbook can now be edited by users just
like a standard workbook (keeping in mind the exceptions listed
previously).

Opening and Editing a Shared Workbook


To edit a shared workbook, users should navigate to the network
folder where the shared workbook is stored and open it just as
you would a regular Excel workbook.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C7


Action C.1 – Sharing a Workbook and Tracking Changes

Instructions: Results/ Comments:


1. Open the Production Totals.xlsx file. It is located in the lessons folder.

2. Save the file as MyProductionTotals. [F12].


xlsx.

3. On the Review Tab, in the Changes The Share Workbook dialog opens.
Group, click on [Share Workbook]
button.

4. Check the checkbox to Allow changes by If this remains un-checked the file will not
more than one user at the same time. be shared.

5. Click on the Advanced Tab If the Allow changes by more than one user
at the same time is un-checked, all options
are greyed out.

6. In the Keep change history for: field The default number of days the history is
change the number of days to 45. kept is 30.

7. Under Update changes, click on the Fifteen minutes is the default.


Automatically every radio button.

8. Leave the remaining defaults and click


[OK].

9. Click [OK] in the Alert dialog to save the The file is saved as a shared workbook.
workbook.

10. Activate the Insert Tab. Since the file has been saved as a shared
workbook most of the options on the tab
are greyed out.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C8
Appendix C: Sharing and Linking Workbooks

Tracking Tracking Changes


Changes The Track changes option will allow you to see any changes that
have been made to the shared workbook by the individual users
sharing it. Even more importantly, it will allow you to accept or
reject any of the changes that have been made to the workbook
over a period that you can specify.

User Credentials for Tracking Changes


Users should ensure they have a User name entered on their
Excel application, so the changes they make will be identified
with their user. These credentials usually appear in the file
properties of workbooks the user has created.

› Click the [Excel Options] button on the File Tab to


display the Excel Options dialog.

Changing the User


name in Excel
› In the Excel Options dialog, choose the General heading
will also change
it for the other Office from the panel on the left, and then enter your user
Applications (Word, name in the User name: field near the bottom.
PowerPoint, Access, etc.)
you have installed. › Click the [OK] button to close the Excel Options dialog.
Highlighting Changes
› Click on the Review Tab.
› Select the [Track Changes] button drop-down.

› Select Highlight Changes... from the drop-down menu.


This opens the Highlight Changes dialog.
› Click on the Track changes while editing checkbox. This
will activate the options for you to highlight which
changes specifically you would like to see highlighted.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C9


Appendix C: Sharing and Linking Workbooks

Tracking When you first set up a workbook for sharing, you will see an
option for keeping the change history for the workbook under
Changes, the Advanced Tab in the Share Workbook dialog.
continued
This option is selected by default. If you select Don’t keep changes,
you will not be able to track the changes to the shared workbook.

In the Highlight Changes dialog you can choose:


› When: which refers to what date you want as the
reference point for tracking the changes.
› Who: which refers to the user or users whose changes
you want to track.
› Where: which refers to the specific cell or range that
you want to track changes in.
› At the bottom of the box, you can choose to highlight
changes on screen or list changes on a new sheet, or
both.
Checking the Highlight Changes on Screen option will highlight
any cells that have been changed with a blue border and a blue
comment triangle in the upper left.

The comment shows information about the changes to the cell. It


includes the person who modified the cell, when it was modified,
and the previous and current values. To see a comment, just
let your mouse pointer hover over an highlighted cell and the
comment will automatically expand.

Page C10 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks

Tracking The History worksheet


Changes, The List Changes on a New Sheet option will generate a new
temporary worksheet labeled History that details the changes
continued
made to the workbook. The History sheet is displayed while
working in the shared workbook, when Track Changes is active.
This sheet is only available while working in the file currently, it
is removed when you use the Accept/Reject Change tool, or save
the file. To view the History worksheet again, you must open the
The History Highlight Changes dialog and checking the List changes on a new
worksheet is sheet check box.
available until
the file is saved, or
the Accept/Reject In the History worksheet, you can sort the changes or apply
Changes is used. filters from the AutoFilter drop lists associated with each column
heading. The last two columns, Action Type and Losing Action,
apply to conflict resolution for workbooks that are shared
from a shared network folder. You can always use the History
worksheet or the highlighted changes on screen as a reference if
you want to re-enter some of the older values and undo changes.

Adding the History Worksheet


› Choose Highlight Changes from the menu of the [Track
Changes] drop-down button.
› In the Track Changes dialog:
› Check the When: field checkbox and choose All
from the field drop-down.
› Leave the Who: and Where: checkboxes unchecked.
› Check the List changes on a new sheet checkbox.
› Click the [OK] button

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C11


Action C.2 – Tracking Changes

Instructions: Results/ Comments:


1. The MyProductionTotals file should still If not, reopen it.
be open.

2. On the Review Tab, in the Change


Group, click the [Track Changes] button
drop-down.

3. Choose Highlight Changes from the list. The Highlight Changes dialog opens.

4. Check the Track Changes while editing If the workbook has not already
checkbox. been shared, checking this checkbox
automatically shares the workbook.

5. Check the When: checkbox and leave the Any change made since you last saved the
field as Since I last saved. file will be highlighted.

6. Check the Who: checkbox and leave the Changes made by any user of the file will
field as Everyone. be highlighted.

7. Check the Highlight changes on screen As changes are made they are highlighted
checkbox. with a blue border and triangle in the
upper left corner of the cell.

8. Click the [OK] button. The Highlight Changes dialog is closed and
Tracking is turned on.

9. Select cell B3 and change the value to: The cell is highlighted.
<26562>.

10. Select cell C3 and change the value to: The cell is highlighted.
<45254>.

11. Hover over cell B3. The Change Comment is displayed.

12. Save the file. [Ctrl+S].

13. On the Review Tab, in the Change


Group, click the [Track Changes] button
drop-down.

14. Choose Highlight Changes from the list. The Highlight Changes dialog opens.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C12
Action C.2 – Tracking Changes, continued

Instructions: Results/ Comments:


15. Check the When: checkbox and select All This will show all changes made to the
from the field drop-down. file since the Track Changes was turned
on. This is subject to the time defined
in the Keep Change History field on
the Advanced Tab in the Share Workbook
dialog.

16. Check the List changes on a new sheet This will add a new worksheet to the file,
checkbox. detailing the change history.

17. Click the [OK] button. The Track Changes dialog closes and a
History worksheet is added to the file.

18. Activate the History worksheet. Click the History tab.

19. Examine the History sheet. Information about the changes to the file
are listed. The last two columns are blank
since no review of the changes has been
done yet.

20. Save and close the file. [Ctrl+S] and [Ctrl+W].

21. Reopen the MyProductionTotals.xlsx [Ctrl+O]. Notice that the changes are not
file. highlighted and the History sheet is no
longer part of the workbook.

22. On the Review Tab, in the Change You will turn Track Changes back on.
Group, click the [Track Changes] button
drop-down.

23. Choose Highlight Changes from the list. The Tack Changes dialog opens.

24. Check the When: checkbox and select All This will show all changes again.
from the field drop-down.

25. Check the List changes on a new sheet This will add the History worksheet to the
checkbox. files again.

26. Click the [OK] button. The Track Changes dialog closes. All
changes are highlighted and the History
worksheet is added to the file.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C13
Appendix C: Sharing and Linking Workbooks

Resolving Resolving Conflicts a Shared Workbook


Conflicts As mentioned previously, it is possible for two or more users
to save a shared workbook after making changes to the same
cells. The problem with this is that Excel can only keep one set of
values in the cells of a given worksheet at a given time.

On the Advanced Tab of the Shared Workbook dialog, you can


specify a method for conflict resolution for situations like the
one just described. Under the Conflicting changes between users
heading, Excel provides two options for resolving a cell value
conflict.

If you select the Ask me which changes win option, you will see
a Resolve Conflicts dialog when you try to save a shared file that
has a conflict. In the Resolve Conflicts dialog, you can choose what
version of the conflicting cells to keep. When a conflict of this
kind occurs, the last user to save the shared workbook will see
the Resolve Conflicts dialog and have the choice of what to keep.

If you select the Changes being saved win option button, the
changes made by the user that saves last will be implemented.

In the following example, the Ask me which changes win option


is used for the shared workbook. Imagine that a user named Lisa
makes changes to a particular cell in the shared workbook. She
then clicks the [Save] button to save her version of the shared
workbook. Next, without knowledge of Lisa’s actions, you make
changes to the same cell or cells in the shared workbook, and
then try to save your version.

When you try to save the changes you made, the following dialog
will appear.

Page C14 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks

Resolving Here you can see the conflict in terms of the change that you
made and the change that Lisa made. You can click the [Accept
Conflicts, Mine] button, to implement the change that you made, or
continued you can click the [Accept Other] button, to implement the
change made by the other user. If you wish, you can resolve
all conflicting changes by clicking the [Accept All Mine] or the
[Accept all Others] button. [Accept All Mine] will resolve the
conflicts by implementing your cell values. [Accept All Others]
will resolve the conflicts by implementing the data entries made
by other users.

Remember, the last person to save the shared workbook gets to


resolve any conflicts that occur with regard to the changes that
they have made.

If you click the [Share Workbook] button on the Review Tab


You will only see when you are editing a shared workbook, you will see all of the
the Resolve Conflicts other users that are working on the same shared workbook at the
dialog if you are same time.
trying to save
a shared file at
the same time as
someone else.

Here you can see that a user named Brian and a user named Lisa
are currently working on the shared workbook.
If you click the [Remove User] button, you will see the following
alert.

When you click [OK], the user that you selected will be removed
(disconnected) from the shared workbook. Any unsaved work
that they have done will be lost.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C15


Appendix C: Sharing and Linking Workbooks

Accepting Accepting and Rejecting Changes


and Rejecting › Click the Accept/Reject Changes option from the [Track
Changes] button menu, to see the following dialog and
Changes select which changes you wish to keep and which you
would like to discard.
› This will open the Select Changes to Accept or Reject
dialog, where you can specify one or more of three
checkboxes to restrict which changes you wish to view.
Once changes
are accepted
or rejected
and the highlight
changes are reapplied,
only changes that
were accepted are
displayed

Not Yet Reviewed means that all changes that have not yet been
accepted or rejected will be subject for review.
› Click [OK].
› The Accept or Reject Change dialog opens.

› Now you can step through each change to the


workbook and choose to accept or reject it.
Clicking the [Accept] or the [Reject] button will implement your
choice and load the next change into view.

Page C16 Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Action C.3 – Accepting /Rejecting changes

Instructions: Results/ Comments:


1. Open the Production Totals Shared.xlsx It is located in the lessons folder.
file.

2. Activate the Review Tab.

3. On the Review Tab, in the Change


Group, click the [Track Changes] button
drop-down.

4. Choose Highlight Changes... from the The Highlight Changes dialog opens.
menu.

5. Set the When: field to All from the menu. This will display all changes made to the
file since Track Changes was turned on.

6. Click [OK]. This Tack Changes dialog is closed and


previous changes are highlighted.

7. Click on the [Track Changes] button in


the Changes Group.

8. Choose Accept/Reject Changes from the The Select Changes to Accept or Reject dialog
menu. opens.

9. Set the When: field to Not yet reviewed The Accept or Reject Changes dialog opens
and click [OK]. showing the first change information.

10. Select the middle option from the list and Since this cell has had several changes
click the [Accept] button. made to it, there is a list of changes in the
Select a value for cell B3: field. The first
change is accepted and the next change is
displayed in the Accept or Reject Changes
dialog

11. Click the [Reject] button to reject the The original values are re-entered into the
change. cell and the next change is displayed.

12. Click [Accept All] button. All the other changes to the file are
accepted at once and the Accept or Reject
Changes dialog closes.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C17
Action C.3 – Accepting /Rejecting changes, continued

Instructions: Results/ Comments:


13. Click the [Track Changes] button on the The Highlight Changes dialog opens.
Review Tab again and choose Highlight
Changes form the menu.

14. Set the When: field to All and uncheck


the Who: and Where: checkboxes.

15. Click the checkbox to List changes on a


new sheet.

16. Click [OK]. The Highlight Changes dialog closes and the
History sheet is added to the workbook.

17. View the History sheet. The new worksheet lists all changes and
their status.

18. Activate the Input worksheet. Notice that only accepted changes are
highlighted on the worksheet.

19. Close the file without saving any [Ctrl + W].


changes.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C18
Appendix C: Sharing and Linking Workbooks

Protecting Protecting a Shared Workbook


Shared Before you share a workbook, you will see a [Protect and Share
Workbook] button on the Review Tab. Clicking on this button
Workbooks will let you simultaneously share and protect the workbook
against deletion of the change history.

After you share a workbook, this button changes to a [Protect


Shared Workbook] button. At this point, you can still protect
the workbook against deletion of the change history, but you no
longer have the ability to add a password.

Passwords can change history, but you no longer have the


ability to add a password. Passwords can only be added if the
workbook is unshared.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019 Page C19


Action C.4 – Protecting a Shared Workbook

Instructions: Results/ Comments:


1. Open a new blank file. [Ctrl+N].

2. Activate the Review Tab.

3. Click on the [Protect and Share The Protect Shared Workbook dialog
Workbook] button in the Changes opens.
Group.
The Password: field is active.
4. Check the Sharing with track changes
checkbox to turn on Sharing with track
changes.

5. Click into the Password: field and type


in:
"Password".
The Confirm Password dialog opens.
6. Click the [OK] button.

7. Click into the Reenter password to


proceed: field and type in:
<Password>.
The Save As dialog opens.
8. Click the [OK] button.
The file is saved as a shared workbook.
9. Name the file Protected.xlsx and click the
[Save] button.
The new worksheet is added to the file.
10. Click the [Add new Worksheet] button.
You are not able to delete the worksheet
11. Right click the sheet tab. since the file is shared.

Most of the buttons are greyed out because


12. Activate the Insert Tab. the file is shared.

13. Activate the Review Tab.


The Unprotect Sharing dialog opens.
14. Click on the [Unprotect Shared
Workbook] button in the Changes
Group.

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C20
Action C.4 – Protecting a Shared Workbook, continued

Instructions: Results/ Comments:


15. Enter the password to turn off the You have to know the password to turn off
Sharing and protection. sharing and protection.

16. Click the [OK] button. The Unprotect Sharing dialog closes.

17. Save and close the workbook. [Ctrl+S] and [Ctrl+W].

Excel 2019: Level 3, Rel. 1.0, 11/11/2019


Appendix C: Sharing and Linking Workbooks, Page C21
Tips and Notes
TCW BOOK
CODES
MICROSOFT OFFICE EXCEL
Excel Level 1 L-1
ASSOCIATE EXAM MO-200
Excel Level 2 L-2
Excel Level 3 L-3 Import data into workbooks
Excel Formulas FM Import data from .txt file DA
Excel Data Analysis DA Import data from .csv files DA
Excel Charts CH
Excel PivotTables PT
Navigate within workbooks
Excel Data Analysis with
PowerPivot PPT Search for data within a workbook L-1
Navigate to named cells, ranges, or workbook
L-2
elements
Insert and remove hyperlinks L-3

Format worksheets and workbooks


Modify page setup L-1
Adjust row height and column width L-1
Customize headers and footers L-1

Customize options and views


Customize the Quick Access toolbar L-1
Display and modify workbook content in
L-2
different views
Freeze worksheet rows and columns L-2
Change window views L-2
Modify basic workbook properties L-2
Display formulas L-1

Configure content for collaboration


Set a print area L-1
Save workbooks in alternative file formats L-1
Configure print settings L-1
Inspect workbooks for issues L-1
TCW BOOK Manipulate data in worksheets
CODES Paste data by using special paste options L-1
Fill cells by using Auto Fill L-1
Excel Level 1 L-1
Excel Level 2 L-2 Insert and delete multiple columns or rows L-1
Excel Level 3 L-3 Insert and delete cells L-1
Excel Formulas FM
Excel Data Analysis DA Format cells and ranges
Excel Charts CH
Merge and unmerge cells L-1
Excel PivotTables PT
Excel Data Analysis with Modify cell alignment, orientation, and
L-1
PowerPivot PPT indentation
Format cells by using Format Painter L-1
Wrap text within cells L-1
Apply number formats L-1
Apply cell formats from the Format Cells dialog
L-1
box
Apply cell styles L-1
Clear cell formatting L-1

Define and reference named ranges


Define a named range L-2 / FM
Name a table DA

Summarize data visually


Insert Sparklines L-2
Apply built-in conditional formatting L-2
Remove conditional formatting L-2

Create and format tables


Create Excel tables from cell ranges L-2
Apply table styles L-2
Convert tables to cell ranges L-2

Modify tables
Add or remove table rows and columns L-2
Configure table style options L-2
Insert and configure total rows L-2
TCW BOOK Filter and sort table data
CODES Filter records L-2
Sort data by multiple columns L-2
Excel Level 1 L-1
Excel Level 2 L-2
Excel Level 3 L-3 Insert references
Excel Formulas FM Insert relative, absolute, and mixed references L-1
Excel Data Analysis DA Reference named ranges and named tables in
Excel Charts CH L-2
formulas
Excel PivotTables PT
Excel Data Analysis with
PowerPivot PPT
Calculate and transform datas
Perform calculations by using the AVERAGE(),
L-1
MAX(), MIN(), and SUM() functions
Count cells by using the COUNT(), COUNTA(),
DA
and COUNTBLANK() functions
Perform conditional operations by using the
FM
IF() function

Format and modify text


Format text by using RIGHT(), LEFT(), and
DA
MID() functions
Format text by using UPPER(), LOWER(), and
DA
LEN() functions
Format text by using the CONCAT() and
DA
TEXTJOIN() functions

Create charts
Create charts L-2 / CH
Create chart sheets L-2 / CH

Modify charts
Add data series to charts L-2 / CH
Switch between rows and columns in source
L-2 / CH
data
Add and modify chart elements L-2 / CH
TCW BOOK
CODES
MICROSOFT OFFICE EXCEL
Excel Level 1 L-1
EXPERT EXAM MO-201
Excel Level 2 L-2
Excel Level 3 L-3 Manage workbooks
Excel Formulas FM Copy macros between workbooks L-3
Excel Data Analysis DA Reference data in other workbooks L-3
Excel Charts CH Enable macros in a workbook L-3
Excel PivotTables PT Manage workbook versions L-2
Excel Data Analysis with
PowerPivot PPT
Prepare workbooks for collaboration
Restrict editing L-2
Protect worksheets and cell ranges L-2
Protect workbook structure L-2
Configure formula calculation options FM
Manage comments L-2

Use and configure language options


Configure editing and display languages L-1
Use language-specific features L-1

Fill cells based on existing data


Fill cells by using Flash Fill L-1
Fill cells by using advanced Fill Series
L-2
options

Format and validate data


Create custom number formats L-1
Configure data validation L-3 / FM
Group and ungroup data L-3
Calculate data by inserting subtotals and
L-3
totals
Remove duplicate records DA
TCW BOOK Apply advanced conditional formatting and filtering
CODES Create custom conditional formatting rules L-2
Create conditional formatting rules that use
Excel Level 1 L-1 L-2
formulas
Excel Level 2 L-2
Excel Level 3 L-3 Manage conditional formatting rules L-2
Excel Formulas FM
Excel Data Analysis DA Perform logical operations in formulas
Excel Charts CH Perform logical operations by using
Excel PivotTables PT nested functions including the IF(), IFS(), FM
Excel Data Analysis with SWITCH(),
PowerPivot PPT
SUMIF(), AVERAGEIF(), COUNTIF(),
SUMIFS(), AVERAGEIFS(), COUNTIFS(), FM
MAXIFS(),
MINIFS(), AND(), OR(), and NOT()
FM
functions

Look up data by using functions


Look up data by using the VLOOKUP(),
HLOOKUP(), MATCH(), and INDEX() FM
functions

Use advanced date and time functions


Reference date and time by using the
FM
NOW() and TODAY() functions
Calculate dates by using the WEEKDAY()
FM
and WORKDAY() functions

Perform data analysis


Summarize data from multiple ranges by
L-3
using the Consolidate feature
Perform what-if analysis by using Goal Seek
L-3
and Scenario Manager
Forecast data by using the AND(), IF(), and
FM
NPER() functions
Calculate financial data by using the PMT()
FM
function
TCW BOOK Troubleshoot formulas
CODES Trace precedence and dependence FM
Monitor cells and formulas by using the
Excel Level 1 L-1 FM
Watch Window
Excel Level 2 L-2
Excel Level 3 L-3 Validate formulas by using error checking
FM
Excel Formulas FM rules
Excel Data Analysis DA Evaluate formulas FM
Excel Charts CH
Excel PivotTables PT Create and modify simple macros
Excel Data Analysis with
Record simple macros L-3
PowerPivot PPT
Name simple macros L-3
Edit simple macros L-3

Create and modify advanced charts


Create and modify dual axis charts CH
Create and modify charts including Box &
Whisker, Combo, Funnel, Histogram, Map, CH
Sunburst, and Waterfall charts

Create and modify PivotTables


Create PivotTables PT
Modify field selections and options PT
Create slicers PT
Group PivotTable data PT
Add calculated fields PT
Format data PT

Create and modify PivotCharts


Create PivotCharts PT
Manipulate options in existing PivotCharts PT
Apply styles to PivotCharts PT
Drill down into PivotChart details PPT

You might also like