Presentation is loading. Please wait.

Presentation is loading. Please wait.

McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lab 5 Using Data Tables, Creating.

Similar presentations


Presentation on theme: "McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lab 5 Using Data Tables, Creating."— Presentation transcript:

1 McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lab 5 Using Data Tables, Creating Macros, and Designing Onscreen Forms

2 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 2 McGraw-Hill/Irwin Objectives 1.Use the PMT function. 2.Use a data table. 3.Add controls. 4.Create a macro with the Visual Basic Editor. 5.Create a macro with the Macro Recorder. 6.Name a range. 7.Use the IF function. 8.Create a form. 9.Add cell comments. 10.Document a file.

3 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 3 McGraw-Hill/Irwin Concepts Overview 1.Data Table - A data table is a type of what-if analysis in which one or more variables are changed to see the effect on the formulas that include these variables. 2.Macro - A macro is a stored series of keystrokes and commands that are executed automatically when the macro is run. 3.Controls - Graphic objects that are designed to help the user interact with the worksheet. 4.Visual Basic Editor - The Visual Basic Editor is a tool used to write and edit macros attached to Excel workbooks.

4 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 4 McGraw-Hill/Irwin Concepts Overview 5.Macro Recorder - The Macro Recorder tool automatically creates a macro by recording a series of actions as macro commands. 6.Form - A form is a formatted worksheet with blank spaces that can be filled in online or on paper. 7.IF Function - The IF function checks to see if certain conditions are met and then takes action based on the results of the check. 8.Comments - Comments are notes attached to cells that can be used to clarify the meaning of the cell contents, provide documentation, or ask a question.

5 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5 McGraw-Hill/Irwin Outline Calculating a Loan Payment –Using the PMT Function Using a Data Table –Creating a One Variable-Data Table Automatically Formatting Worksheet Data –Applying an Autoformat

6 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 6 McGraw-Hill/Irwin Outline Automating Tasks with Macros –Changing the Macro Security Level –Creating a Command Button Create a Macro Using the Visual Basic Editor –Running the Macro Using the Macro Recorder –Editing a Macro

7 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 7 McGraw-Hill/Irwin Outline Creating a Form –Naming Ranges Using the IF Function –Adding a Combo Box Control –Adding Comments Finalizing the Form –Hiding Rows Lab Review

8 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 8 McGraw-Hill/Irwin What would the monthly loan payments be for different down payments, interest rates, and repayment periods? Calculating a Loan Payment

9 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 9 McGraw-Hill/Irwin Using the PMT Function Calculates a periodic payment on a loan Value returned includes … –Loan amount –Interest (no taxes) –Reserve payments –Fees sometimes associated with loans

10 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 10 McGraw-Hill/Irwin PMT Function PMT(rate, npr, pv) –Three arguments: Rate - interest rate of loan Npr – total number of payments for the loan Pv – amount of the loan, called the principal Results displayed in the field containing the function

11 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 11 McGraw-Hill/Irwin Shows the effect of using different values in a calculation Used to calculate multiple what-if versions in one operation Can view the results of all variations in the worksheet When would you use a data table? Concept 1: DATA TABLE

12 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 12 McGraw-Hill/Irwin Data Tables One-variable data table –Contains one or more formulas –Each formula refers to one input cell –Input cell – a list of values Column-oriented – listed down a column Row-oriented – listed across a row Example – varying interest rates

13 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 13 McGraw-Hill/Irwin Data Tables cont. Two-variable data table –Uses only one formula –Refers to two different input cells One column-oriented and one row-oriented Purpose of two-variable table –Shows the resulting effect on the formula when the values in both cells are modified Example – varying interest rates and varying length of loan

14 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 14 McGraw-Hill/Irwin Autoformat –A built-in combination of formats –Applied to a range of cells –Consist of a combination of formatting and enhancement options Applying an Autoformat –Specify range of cells –Choose Format/Autoformat Automatically Formatting Worksheet Data

15 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 15 McGraw-Hill/Irwin Stored series of keystrokes and commands Stored actions run automatically when macro is executed Useful for replacing a series of repeated commands Macros range from simple to complex Concept 2: MACRO

16 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 16 McGraw-Hill/Irwin More on Macros Changing the Macro Security Level –Can contain viruses –Excel includes three levels of security High Medium - default Low –Digital signature Creating a Command button –A control added to a worksheet –Can be assigned to run a macro

17 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 17 McGraw-Hill/Irwin Graphic objects designed to help user interact with the worksheet Used to… –Enter data –Perform an action –Make worksheet easier to read Modified by changing properties Concept 3: CONTROLS

18 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 18 McGraw-Hill/Irwin More on Controls Examples –Check boxes –List boxes –Option boxes –Command buttons Two ways to add to a worksheet –Forms toolbar –Control Toolbox toolbar

19 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 19 McGraw-Hill/Irwin Programming language Used to write and edit macros Contains an editor for ease of use What is Visual Basic?

20 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 20 McGraw-Hill/Irwin Using Visual Basic Entries –Statements –Sub procedure Syntax – rules of "grammar" for programming –Object ("x").Property Object – item statement will affect Property – action taken on object

21 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 21 McGraw-Hill/Irwin Visual Basic What does this Visual Basic statement mean? Range("C2:C10").Select

22 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 22 McGraw-Hill/Irwin More on Macros Plan a macro before creating it Write out the steps for the macro Try executing the steps manually

23 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 23 McGraw-Hill/Irwin Creating a Macro Remarks Text to display in input box

24 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 24 McGraw-Hill/Irwin Automatically creates a macro Records a series of actions as macro commands Easier than using Visual Basic Editor Better to use for short procedures only Concept 5: MACRO RECORDER

25 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 25 McGraw-Hill/Irwin Macro Recorder Choose Tools/Macro/Record New Macro Enter a name Choose a shortcut key

26 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 26 McGraw-Hill/Irwin Formatted worksheet with blank spaces Can be filled online –Color and shading are more effective online –Can contain formulas that calculate immediately upon data entry Can be printed and completed Concept 6: FORM

27 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 27 McGraw-Hill/Irwin Naming Ranges in a Form Reference to active sheet

28 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 28 McGraw-Hill/Irwin Labels to the left of cells will be range names Using Labels to Create a Range Name

29 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 29 McGraw-Hill/Irwin Range Name Example In place of the cell reference in the Name box, the range name is displayed

30 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 30 McGraw-Hill/Irwin Paste Name in Formula

31 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 31 McGraw-Hill/Irwin Range Names Name used in place of cell reference

32 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 32 McGraw-Hill/Irwin A function that checks to see if certain conditions are met Takes action based on the results of the check IF(logical_test, value_if_true,value_if_false Logical test argument asks the question "Does the entry in this cell meet the stated conditions?" Concept 7: IF FUNCTION

33 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 33 McGraw-Hill/Irwin Logical Operators SymbolMeaning =Equal to <Less than >Greater than <=Less than or equal to >=Greater than or equal to <>Not equal to NOTLogical NOT ANDLogical AND ORLogical OR

34 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 34 McGraw-Hill/Irwin Nested Function Second If statement

35 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 35 McGraw-Hill/Irwin Combo Box

36 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 36 McGraw-Hill/Irwin Notes attached to the cells Used to –Clarify meaning of data –Provide documentation –Ask a question Adds instructions to a form Concept 8: COMMENTS

37 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 37 McGraw-Hill/Irwin Comments on a Form Comments

38 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 38 McGraw-Hill/Irwin Finalizing the Form Add a command button –Use Control Toolbar –Record and assign a macro Hide nonessential items –Format/Row/Hide Unlock data entry areas and protect others Document the worksheet –File/Properties

39 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 39 McGraw-Hill/Irwin Documentation

40 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 40 McGraw-Hill/Irwin Key Terms Autoformat – A built-in combination of formats that can be applied to a range of cells. The autoformats consist of a combination of number formats, fonts and attributes, colors, patterns, borders, frames, and alignment settings. Column-oriented - In a data table, the orientation of the data in a table down a column as opposed to across a row (row-oriented). Comment - Notes attached to cells that can be used to help clarify the meaning of the data, provide documentation or ask a question.

41 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 41 McGraw-Hill/Irwin Key Terms Control - Graphic objects that are designed to automate the process of completing information in a worksheet. Data table - A type of what-if analysis where one or more variables are changed to see the effect on the formula or formulas that include these variables. Digital Signature - An electronic encryption-based stamp of authentication that confirms the macro or document originated from the signer and has not been changed. Form - A formatted worksheet that is designed to be completed by filling in data in the blank spaces. If function - A function that checks to see if certain conditions are met and then takes action based upon the results of the check.

42 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 42 McGraw-Hill/Irwin Key Terms Input cell - A cell in which a list of values is substituted to see the resulting effect on the related formulas. Input values can be listed down a column (column-oriented) or across a row (row-oriented). Logical operator - Symbols used in formulas that compare values in two or more cells. Macro - A stored series of keystrokes and commands. When the macro is executed or run, the stored actions are performed automatically. Macro recorder - A tool used to create a macro by recording a series of actions as macro statements as they are performed. Name -The name of a macro. A macro name must begin with a letter, cannot exceed 255 characters and cannot include a space or period or the following characters: ! @ & $ #.

43 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 43 McGraw-Hill/Irwin Key Terms Nested function - A second argument in a function that is enclosed within its own set of parentheses. Nper - In the PMT function, the nper argument is the total number of payments for the loan. Object - An element such as a text box that can be added to a workbook and that can be selected, sized, and moved. In visual Basic, the object is the item that the statement will affect (such as a cell, cell range, worksheet, or workbook). The object is enclosed in parenthesis and surrounded in quotes. One-variable data table - A one-variable data table can contain one or more formulas, and each formula refers to one input cell. An input cell is a cell in which a list of values is substituted to see the resulting effect on the related formulas. Input values can be listed down a column (column-oriented) or across a row (row-oriented).

44 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 44 McGraw-Hill/Irwin Key Terms Principal - In the PMT function, the principal or pv argument is the amount of the loan. Property - In visual Basic Editor, the property is what you want to do to the object. The property consists of 'reserved words' that have special meaning and direct Excel to perform the specified action. Pv - In the PMT function the pv argument is the amount of the loan, also referred to as the principal. Rate - In the PMT function, the rate argument is the interest rate of the loan. Remark Statement - Remark statements describe the macro and include overall procedural documentation. Remark statements always begin with an apostrophe, which tells Excel to ignore the information on that line.

45 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 45 McGraw-Hill/Irwin Key Terms Row-oriented - In a data table, the orientation of the data in a table across a row as opposed to down a column (column-oriented). Run - To execute the commands stored in the macro. Statement - The types of information you enter into the Visual Basic Editor are called statements. Sub procedure - In Visual Basic Editor, a Sub procedure begins with a statement that starts the macro and ends with one that closes the macro (an End Sub statement). Sub procedures can also include remarks about the macro (such as its name and purpose) and functions (such as returning values to the procedure). Syntax - Rules of structure for entering all visual basic statements.

46 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 46 McGraw-Hill/Irwin Key Terms Two-variable Data Table - A data table that uses only one formula that refers to two different input cells, one column-oriented and one row-oriented. The purpose of this table is to show the resulting effect on the formula when the values in both of these cells are changed. Visual Basic Editor - A programming application used to write and edit macros attached to Excel workbooks.

47 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 47 McGraw-Hill/Irwin Discussion Questions 1.Discuss different ways in which a data table can be used. When would you use a one-variable data table? When would a two-variable table be more appropriate? 2.Discuss some spreadsheet functions that you could automate with a macro. Would it be more appropriate to use the Visual Basic Editor or the Macro Recorder to create each of these macros? 3.Discuss what range names are and when it is appropriate to use them. Give some examples.

48 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 48 McGraw-Hill/Irwin Frequently Asked Questions I need a new car. Can Excel help me to calculate loan payments? Data tables seem useful, but I am not sure of how to use one. What are they? My worksheet looks plain and boring. Is there an automatic way in Excel to make it look more attractive? Give examples of when a macro would be helpful.

49 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 49 McGraw-Hill/Irwin Frequently Asked Questions Why am I given a warning message when a workbook contains a macro? What are check boxes, list boxes, and command buttons? What is the difference between using the Macro Recorder and the Visual Basic Editor to create a macro? When would I use either one?

50 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 50 McGraw-Hill/Irwin Frequently Asked Questions What are the benefits of using an Excel form? I understand that Excel cell ranges can have names. What is the benefit of assigning names to ranges? How are they used? How does the IF function work? What is the logical operator for "not equal to"?

51 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 51 McGraw-Hill/Irwin Frequently Asked Questions How can I create a combo box for a list of values? When would I use Excel comments on a worksheet?

52 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 52 McGraw-Hill/Irwin Web Links USD Excel Tutorial –http://www.bamaed.ua.edu/bct100/100top5.htmhttp://www.bamaed.ua.edu/bct100/100top5.htm The MS Excel Knowdule: Tutorial –http://isds.bus.lsu.edu/cvoc/learn/introit/excel/http://isds.bus.lsu.edu/cvoc/learn/introit/excel/ Data Tables :PC Magazine –http://www.zdnet.com/pcmag/pctech/content/so lutions/ss1702a.htmhttp://www.zdnet.com/pcmag/pctech/content/so lutions/ss1702a.htm A Set Size Selection Macro –http://www.zdnet.com/pcmag/pctech/content/so lutions/ss1813a.htmhttp://www.zdnet.com/pcmag/pctech/content/so lutions/ss1813a.htm

53 The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 53 McGraw-Hill/Irwin Web Links It's IFFY – Using Excel's IF Function –http://www.yukonstaffdevelopment.com/Traini ngAndDev/comtips/MSExcel.htm#IT'S%20IFF Yhttp://www.yukonstaffdevelopment.com/Traini ngAndDev/comtips/MSExcel.htm#IT'S%20IFF Y Visual Basic Explorer –http://www.vbexplorer.com/http://www.vbexplorer.com/ Microsoft Visual Basic –http://msdn.microsoft.com/vbasic/http://msdn.microsoft.com/vbasic/


Download ppt "McGraw-Hill/Irwin The O’Leary Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lab 5 Using Data Tables, Creating."

Similar presentations


Ads by Google