© 2002 ComputerPREP, Inc. All rights reserved. Excel 2000: Customizing Excel and Using Macros.

Slides:



Advertisements
Similar presentations
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Advertisements

Microsoft Excel. Click on “Start,” then “Microsoft Office Excel.”
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 6 BACKNEXTEND 6-1 LINKS TO OBJECTIVES Workbook properties Workbook properties Workbook Sharing.
Using Macros and Visual Basic for Applications (VBA) with Excel
Developing an Excel Application
Tutorial 8: Developing an Excel Application
1 CA202 Spreadsheet Application Combining Data from Multiple Sources Lecture # 6.
Microsoft Excel 2003 Illustrated Complete Excel Files and Incorporating Web Information Sharing.
Understanding Microsoft Excel
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
PowerPoint. Getting Started with PowerPoint Objectives Start PowerPoint and open presentations Explore toolbars and menus Use the Office Assistant Work.
Copyright 2003, Paradigm Publishing Inc. CHAPTER 6 BACKNEXTEND 6-1 LINKS TO OBJECTIVES Create and Rename a Folder Create and Rename a Folder Delete Workbooks.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Microsoft Excel 2003 Illustrated Complete Excel and Advanced Worksheet Management Customizing.
Lecture 1 Introduction to Excel OVERVIEW Introduction Basics of Cells Modifying Columns and Rows Formatting Cells Saving Working with Formulas Basics.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Access Tutorial 10 Automating Tasks with Macros
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Forms, Merges, and Macros.
© 2002 ComputerPREP, Inc. All rights reserved. Word 2000: Working with Long Documents.
Lesson 1 – Microsoft Excel The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
1 Essential Worksheet Operations Applications of Spreadsheets.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Key Applications Module Lesson 16 — Excel Essentials Computer Literacy BASICS.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 10 Creating and Formatting an Excel Worksheet.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
1 Performing Spreadsheet What-If Analysis Applications of Spreadsheets.
© 2002 ComputerPREP, Inc. All rights reserved. Excel 2000: Module II.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Key Applications Module Lesson 21 — Access Essentials
Copyright 2002, Paradigm Publishing Inc. CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Worksheet Elements Worksheet Elements Worksheet Area Elements Worksheet.
Basic Editing Lesson 2.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Chapter 9 Macros And Visual Basic For Applications.
Copyright 2007 Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Create a Chart with Data in a Worksheet Create a Chart.
Lesson 1 – Microsoft Excel * The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Working with Data Lists.
Key Applications Module Lesson 14 — Working with Tables Computer Literacy BASICS.
Chapter 11 Collaboration Features for Workbooks Microsoft Excel 2013.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
1 Word Processing Intermediate Using Microsoft Office 2000.
Excel Chapter 1 Creating a Worksheet and an Embedded Chart
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Microsoft Excel Illustrated Introductory Workbooks and Preparing them for the Web Managing.
Chapter 8 Using Document Collaboration, Integration, and Charting Tools Microsoft Word 2013.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Understanding Microsoft Excel
Excel Tutorial 8 Developing an Excel Application
Understanding Microsoft Excel
Microsoft Excel 2003 Illustrated Complete
Understanding Microsoft Excel
Exploring Microsoft Excel
Understanding Microsoft Excel
Objectives At the end of this session, students will be able to:
Key Applications Module Lesson 14 — Working with Tables
Microsoft Excel 2007 – Level 2
Presentation transcript:

© 2002 ComputerPREP, Inc. All rights reserved. Excel 2000: Customizing Excel and Using Macros

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 1: Customizing Excel Workspaces

Objectives Set options Customize toolbars Arrange and save workspaces

Setting Options Set options to change the default appearance and behavior of Excel To set options: –Display the Options dialog box –Click on the card containing the settings you want to change –Change the desired options

Customizing the Display of Menus and Toolbars By default: –The Standard and Formatting toolbars share one row –Menus display only frequently used commands To specify how menus and toolbars display: –Display the Options card of the Customize dialog box –Specify to display each toolbar on its own –Specify to display full menus –Click on “Reset my usage data” to restore the default display

Creating Custom Toolbars Create a custom toolbar to contain command buttons you use frequently that are in several different toolbars To create a custom toolbar: –Display the Toolbars card of the Customize dialog box and click on the New button –Specify a name for the custom toolbar –Display the Commands card and drag the command buttons you want to the custom toolbar

Adding and Deleting Toolbar Buttons You can add, delete and rearrange toolbar buttons on any toolbar by dragging them while the Customize dialog box is open If the Customize dialog box is closed: –To move a button: press and hold ALT and drag the button –To copy a button: press and hold CTRL+ALT and drag the button –To delete a button: press and hold ALT and drag the button into the worksheet area

Resetting and Deleting Toolbars You can reset built-in toolbars, but not custom toolbars You can delete custom toolbars, but not built-in toolbars To reset a built-in toolbar: –Display the Toolbars card of the Customize dialog box, click on the toolbar you want to reset, then click on the Reset button To delete a custom toolbar: –Display the Toolbars card of the Customize dialog box, click on the toolbar you want to delete, then click on the Delete button

Arranging and Saving Workspaces Workspace file – a file that contains a group of workbooks arranged for efficient access To create a workspace file: –Open and arrange the workbooks that you want to include in the workspace –Display the Save Workspace dialog box and specify a name for the workspace

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 2: Customizing Startup

Objectives Open workbooks at startup Open custom workspaces at startup Create desktop icons

Opening Workbooks and Custom Workspaces at Startup Startup folder – a folder that contains files that will open automatically every time you start Excel The Xlstart folder is the startup folder for Excel You can copy one or more workbooks to the Xlstart folder If the Xlstart folder is empty, a blank workbook displays when you start Excel You can also open a workspace file by saving the workspace in the Xlstart folder

Creating Desktop Icons You can create desktop icons that start Excel and open workbooks or workspaces automatically To create desktop icons: –Create a shortcut that launches the application using the Create Shortcut dialog box –Display the Shortcut card of the Properties dialog box –Click at the end of the text string in the Target text box –Press SPACE, then type the name of the file you want to open

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 3: Collaborating with Workgroups

Objectives Create templates Edit templates Create AutoTemplates Collaborate with workgroups

Creating Templates Template – a workbook you use to create other workbooks that will have the same formatting and page layout When you create a template: –Include the text, graphics, formatting, and macros that will apply to all workbooks you create based on the template –Do not include data that will vary from workbook to workbook –Unlock data entry cells and apply worksheet protection

Creating Templates (cont’d) To create a template: –Open (or create) the workbook from which you will create the template –Display the Save As dialog box –Click on Template (*.xlt) in the Save as type drop-down list –Type a name for the template –Click on the Save button

Creating Templates (cont’d) To create a new workbook based on a template: –Display the New dialog box –Double-click on the name of the template on which you want to base the new workbook –Enter data in the data entry cells and save the workbook with a new name

Editing Templates Edit templates just as you would edit any worksheet you create in Excel To edit a template: –Open the template that you want to edit –Deactivate worksheet protection if necessary –Make the desired changes –Save the template

Creating AutoTemplates AutoTemplate – a template on which new workbooks are based by default To create an AutoTemplate: –Create a workbook with the formatting you want –Save the workbook as a template named “Book” in the Xlstart folder You must name the template “Book”; if you use any other name, Excel will continue to use the default workbook layout

Changing Workbook Properties You can view and set workbook properties using the five cards in the Properties dialog box: –General card – displays the file type, name, location, and other attributes –Summary card – allows you to add specific information about the workbook –Statistics card – displays the creation date, the last time the workbook was modified, the user who modified it, and the number of revisions –Contents card – displays worksheet names, charts, reports and macro sheets –Custom card – enables you to create your own custom properties

Creating a Shared Workbook Shared workbook – a workbook that has been set up to allow multiple users on a network to view and edit the workbook simultaneously After you share a workbook, Excel automatically keeps track of the changes by you and by other users by maintaining a change history –Change history – a log of all changes made to a shared workbook during a specified time period

Viewing Tracked Changes When you share a workbook, Excel keeps track of changes made by you or other users When you activate tracked changes, changed cells are surrounded by blue boxes with a triangle in the upper-left corner The column and row indicators for the changed cells display in red When you position the mouse pointer over a changed cell, a comment displays describing the change

Accepting and Rejecting Changes When tracked changes is active, you can choose to accept or reject changes You can accept or reject each change individually or You can accept all changes or reject all changes at once

Merging Workbooks You can merge workbooks to join all changes together Before merging, workbooks must meet the following requirements: –Workbooks must be copies of the same workbook –Each copy must have a different file name –The workbooks must either not have passwords or all have the same password –The workbook from which the copies were originally made must have been a shared workbook –When copies were made, the change history must have been turned on

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 4: Using AutoFormats in Worksheets and Charts

Objectives Use built-in AutoFormats Create custom chart formats

Applying AutoFormats to Worksheets AutoFormat – a set of formatting commands such as font size, patterns or alignment that you apply to selected cells at one time To apply an AutoFormat to a worksheet: –Display the AutoFormat dialog box –Select an AutoFormat –Click on Options to specify the type of AutoFormat to apply: numbers, borders, fonts, patterns, text and graphic alignment, column widths and row heights –Click on OK

Applying AutoFormats to Charts To apply AutoFormats to charts: –Display the Standard Types card of the Chart Type dialog box –Specify a chart type and chart sub-type –Click on OK

Creating Custom Chart Formats You can format a chart, save the format as a custom chart type, then apply it to other charts You can create a new chart format or modify a built-in chart format Modify chart formats using the Format dialog box for various chart elements Save the custom chart format using the Custom Types card of the Chart Type dialog box

Creating Custom Chart Formats (cont’d) To apply a custom chart type: –Display the Custom Types card of the Chart Type dialog box –Display the user-defined chart types –Double-click on the custom chart type To delete a custom chart type: –Display the Custom Types card of the Chart Type dialog box –Display the user-defined chart types –Click on the custom chart type, then click on Delete You cannot restore a deleted custom chart type

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 5: Controlling Macros

Objectives Control macro cell references Save macros for selective use

Reviewing Macros Macro – a series of commands that you record or write, and that you can play back later to automate your work Visual Basic – a programming language used to write programs and macros in Microsoft Office applications Module sheet – a worksheet that contains a macro or macros Use the Record Macro dialog box to start macro recording and display the Stop Recording toolbar Use the Macro dialog box to run, edit and delete macros

Controlling Macro Cell Reference The Stop Recording toolbar contains: –The Stop button –The Relative Reference button Use the Relative Reference button to toggle between specifying a(n): –Relative cell reference – allows the macro to target varying cells, depending on the current position of the cell pointer, or –Absolute cell reference - ensures that the macro will always process the same worksheet cells (the default)

Saving Macros for Selective Use You can save macros: –In the current workbook (the default) –In a new workbook –In the Personal Macro Workbook Personal Macro Workbook – a workbook that contains macros that are always available in every workbook

Saving Macros for Selective Use (cont’d) To save a macro in the Personal Macro Workbook: –Display the Record Macro dialog box –Display the “Store macro in” drop-down list –Click on Personal Macro Workbook –Continue to record and save the macro To save a macro in a new workbook: –Display the Record Macro dialog box –Display the “Store macro in” drop-down list –Click on New Workbook –Continue to record and save the macro

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 6: Editing Macros

Objectives Open the Visual Basic environment Insert procedures Find and replace code Delete and copy code Add comments

Opening the Visual Basic Environment When you edit a macro, you open the Visual Basic environment, which consists of three windows: –The Project Explorer window – displays a hierarchical list of worksheets and modules in the workbook –The Code window – displays the Visual Basic code for the current macro –The Immediate window – used to test the results of commands you type

Opening the Visual Basic Environment (cont’d) To open the Visual Basic environment: –Display the Macro dialog box –Select the macro you want to edit –Click on the Edit button

Inserting Procedures Procedure – a group of statements and commands that produces a result Procedures always begin with a Sub statement and end with an End Sub statement To insert procedures: –Type Visual Basic code in the Code window, or –Record macro keystrokes, then copy and paste the code into the Code window of an existing macro

Finding and Replacing Code You can use the Edit Find and Edit Replace features to find and replace code in a macro in the same manner as you would text in a worksheet In the Visual Basic environment, the Find and Replace dialog boxes contain options for searching: –Procedures –Modules –Projects –Selected text

Deleting and Copying Code When you record a macro, code is generated for every action you perform until you stop recording You delete and copy macro code in the Code window in the same manner as you would edit text

Adding Comments Comments are text you can add within a macro that are not part of the macro code To designate text as a comment, type an apostrophe (‘) as the first character in the comment line When you run the macro, all comments will be ignored

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 7: Running Macros from Menus and Buttons

Objectives Assign macros to the menu bar Assign macros to toolbar buttons Assign macros to worksheet buttons Change assigned macros

Assigning Macros to the Menu Bar To assign a macro to a menu bar command: –Display the Commands card of the Customize dialog box –Select Macros and drag Custom Menu Item to the menu bar –Specify a name for the new menu item –Assign a macro to the new menu item Click on the new menu bar command to run the assigned macro

Assigning Macros to Built-in Toolbar Buttons To assign a macro to a built-in toolbar button: –Display the Commands card of the Customize dialog box –Right-click on the toolbar button, click on Assign Macro, then double-click on the macro you want to assign to the button Click on the toolbar button to run the assigned macro The macro overrides the default function of the button until you reset the toolbar

Assigning Macros to Custom Toolbar Buttons To assign a macro to a custom toolbar button: –Display the Commands card of the Customize dialog box –Click on Macros and drag Custom Button to a toolbar –Right click on the custom button, click on Assign Macro, then double-click on a macro to assign the macro to the button Click on the custom button to run the assigned macro

Assigning Macros to Worksheet Buttons Assign a macro to a worksheet button if you want the macro to be available only in a specific worksheet To create a worksheet button: –Display the Forms toolbar, click on the Button tool, then draw a worksheet button –Double-click on a macro to assign the macro to the worksheet button –Select the default button name and type a name for the worksheet button Click on the worksheet button to run the assigned macro

Changing Assigned Macros To change a macro assigned to a worksheet button: –Press and hold CTRL, click on the worksheet button, then release CTRL to select the button –Change the name of the button if desired –Right-click on a button selection handle, click on Assign Macro, then double-click on a macro to assign the macro to the worksheet button

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 8: Making Macros Interactive

Objectives Display dialog boxes in macros Display message boxes in macros

Displaying Dialog Boxes in Macros You can design a macro to prompt the user for data by displaying a dialog box as the macro executes The data provided by the user determines how the macro will proceed InputBox function – macro code that specifies to display a dialog box that requests input from the user and assigns the entered text to a variable in the macro

Displaying Dialog Boxes in Macros (cont’d) Syntax: InputBox(prompt as string,[title],[default],[left], [top],[helpfile],[helpcontextID],[type]) –prompt – the text that displays in the dialog box –title – the dialog box title –default – the data that displays in the dialog box if the user does not respond –left – the horizontal position of the dialog box –top – the vertical position of the dialog box

Displaying Dialog Boxes in Macros (cont’d) –helpfile – the help file to use to provide context- sensitive help for the dialog box –helpcontextid – the help context number assigned by the help author –type – specifies the data type, such as text (the default), formula, number, logical value (true or false), cell reference, error value or an array of values

Displaying Message Boxes in Macros You can design a macro to add message boxes that provide information during macro execution MsgBox function – macro code that specifies to display a message box during macro execution When the message box displays, the user must click on a button, then the macro will continue running based on the button the user has chosen

Displaying Message Boxes in Macros (cont’d) Syntax: MsgBox(prompt,[buttons],[title],[helpfile],[context]) –prompt – the text that displays in the message box –buttons – specifies the type of buttons that will display (OK, Cancel, Yes, No and so forth) –title – the message box title –helpfile – the help file to use to provide context- sensitive help for the message box –context – the help context number assigned by the help author

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 9: Using Break Mode

Objectives Insert breakpoints Insert stop statements

About Break Mode Break mode – a debugging tool you can use to stop the execution of a macro in order to view the result at the moment the macro stops Debug window – a window that displays the values of expressions and variables in a macro when the macro encounters a break point or stop statement Break point – puts a macro in Break mode and displays the Debug window Stop statement – a line of code that halts a macro during execution and displays the Debug window

Inserting Breakpoints When you insert a breakpoint, you can examine the values of variables, properties, functions and expressions as a macro executes To insert a breakpoint: –Open the Visual Basic environment –Click on the line of code where you want to insert the breakpoint –Click on the Breakpoint button in the Debug toolbar, or –Press F9, or –Right-click on the line of code and click on Toggle, Breakpoint

Inserting Breakpoints (cont’d) You monitor what data a macro is using and the value of variables by adding watch expressions –Watch expression – a macro that is specified for display in the Debug window when the macro execution is in Break mode Use the Add Watch dialog box to add watch expressions You can set as many watch expressions as you want

Inserting Stop Statements Stop statements are similar to breakpoints but you must enter and remove them manually A stop statement consists of the word “Stop” You add a stop statement between lines of macro code at the point where you want the macro to enter Break mode while it is executing

© 2002 ComputerPREP, Inc. All rights reserved. Lesson 10: Stepping Through Macros

Objectives Step over procedures Step into procedures

Stepping Through Macros Stepping – a process by which you can execute macro code one statement at a time When you reach a previously set breakpoint or stop statement, you can choose to step through statements by stepping over them or stepping into them Step over - a process by which you execute all the statements within a procedure at once Step into - a process by which you execute all the statements within a procedure one at a time

Stepping Through Macros (cont’d) Use the step over feature to eliminate errors in the overall structure of the macro and to broadly determine in what procedure the error may lie Use the step into feature to help you exactly pinpoint in what statement an error may lie