McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.

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

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.
Using Macros and Visual Basic for Applications (VBA) with Excel
Developing an Excel Application
Tutorial 8: Developing an Excel Application
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
Templates and Styles Excel Advanced. Templates are pre- designed and formatted spreadsheets –They provide consistency of layout/structure –They.
1 Excel Lesson 1 Understanding Excel Fundamentals Microsoft Office 2010 Fundamentals Story / Walls.
Microsoft Office Excel 2013 Core Microsoft Office Excel 2013 Core Courseware # 3253 Lesson 8: Macros, Importing and Exporting Data.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
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.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
Using the Visual Basic Editor Visual Basic for Applications 1.
Microsoft Excel 2003 Illustrated Complete Excel and Advanced Worksheet Management Customizing.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft PowerPoint 2002 Working with External.
Chapter 12: Recording Macros Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
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)
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Macros and VBA A macro is a set of instructions that tells Excel which commands to execute.
Word Lesson 16 Working with Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Microsoft Office Word 2013 Core Microsoft Office Word 2013 Core Courseware # 3250 Lesson 8: Using Productivity Tools.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Exploring Formulas.
Customizing Microsoft Project
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
© 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.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
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-
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
1 ADVANCED MICROSOFT WORD Lesson 16 – Customizing Features Microsoft Office 2003: Advanced.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Chapter 12: Recording Macros Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.
OCC Network Drives  H:\  P:\ 
Key Applications Module Lesson 21 — Access Essentials
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 2 Manipulating.
© 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 Outlook 2010 Chapter 3 Managing Contacts and Personal Contact Information with Outlook.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft PowerPoint 2002 Working with Visual.
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.
Excel Macros 1 Macros or, How to Automate Part of Your Spreadsheet or Worksheet.
Lesson 14: Exploring Excel Learning Objectives After studying this lesson, you will be able to:  Explain ways Excel can help your productivity.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Access 2002 Advanced Form Design.
Chapter 2: Excel Basics and Formatting Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
1 CA202 Spreadsheet Application Automating Repetitive Tasks with Macros Lecture # 12 Dammam Community College.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Chapter 7 Creating Templates, Importing Data, and Working with SmartArt, Images, and Screen Shots Microsoft Excel 2013.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Lesson 1: Learning Worksheet Fundamentals Microsoft Office Excel 2003 Lesson 1 Learning Worksheet Fundamentals.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Microsoft Office Illustrated
Microsoft Excel 2003 Illustrated Complete
Lesson 1 - Automating Tasks
Objectives At the end of this session, students will be able to:
Shelly Cashman: Microsoft Windows 10
Microsoft Excel 2007 – Level 2
Presentation transcript:

McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson 5

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-2 McGraw-Hill/Irwin Skills Introducing Macros Recording a Macro Running a Macro Editing a Macro Adding and Deleting a Macro from a Toolbar Adding and Deleting a Macro from a Menu Copying Macros to Other workbooks

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-3 McGraw-Hill/Irwin Introducing Macros When working with a spreadsheet the user or designer may need to repeat a series of actions –Across cells –To perform a particular task An overall task needs to be performed easily, quickly, accurately

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-4 McGraw-Hill/Irwin Introducing Macros Series of complicated steps for each cell can be "recorded" –Includes mouse click commands –Keystrokes Then the macro is "played back" for each cell or range desired

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-5 McGraw-Hill/Irwin Introducing Macros Name the macro –Name must start with a letter –Cannot contain spaces –Should not conflict with a cell name

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-6 McGraw-Hill/Irwin Introducing Macros Identify the steps involved –Advisable to write down steps ahead of time –Keeps from missing steps –Avoids extra, unneeded steps

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-7 McGraw-Hill/Irwin Introducing Macros Storing a Macro –May be part of current workbook or … –Stored in a different workbook Could be a workbook containing only macros –Plan ahead as to where this will be

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-8 McGraw-Hill/Irwin Recording a Macro Identify the steps of the macro Set up the conditions under which it will run Note – record actions carefully –All user actions (including mistakes) will be recorded –Both typing mistakes and their corrections will be recorded

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 5-9 McGraw-Hill/Irwin Recording a Macro Preparing to record a Macro –Click on Tools, then Options –Options dialog box appears –Click the Security Tab –Click on Macro Security Since we are recording our own macros, we will use the Low option –Click OK here –Click OK on Options

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Recording a Macro To record –Click on Tools, then Macro, then Record a New Macro

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Recording a Macro Record Macro dialog box appears Name the macro Specify the shortcut key Document the macro, describing what it does Click OK and Stop Recording toolbar appears

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Recording a Macro Perform the steps required by the macro –Click on a cell –Type text or formulas –Click on menu commands Copy, Paste, Insert, Print, etc. –Time spent between mouse clicks or keystrokes is not recorded – just the actions When done click on the Stop Recording button –Toolbar will close … macro has been recorded

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Running a Macro After a macro is recorded –Can be run from any workbook –Performs the recorded actions on the active workbook Recommendations –Save all open files –Then run the new macro To stop a macro, pres [Esc]

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Running a Macro Click on Tools, then Macro – dialog box appears Choose desired macro Click Run Review results to verify correctness of macro

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Editing a Macro Macros are stored in Visual Basic modules –Editing takes place in Visual Basic Editor –This is more efficient than re-recording the macro under the same name Visual Basic Editor –Code window displays instructions –Changing the instructions can be done with minimal knowledge of Visual Basic

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Editing a Macro Click on Tools, then Macro – dialog box appears Choose macro to edit Click on Edit Visual Basic Editor opens

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Editing a Macro Visual Basic Editor window Code Window Each line of code represents an action recorded for the macro Green text denotes comments; does not affect macro execution

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Editing a Macro New Macro Code Newly added code to change value in cell back to original Click X to close Visual Basic Editor window and return to worksheet

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Provides quick and easy access to a macro Button added to toolbar using Customize dialog box When button added to toolbar it is available in all Excel files

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Click Tools, then Customize – dialog box appears Click Commands tab if necessary Choose Macros Note the two custom commands

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Drag the button from the dialog box to the toolbar. –Mouse cursor becomes I beam on toolbar –When mouse button released, icon stays on toolbar I

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Click the Modify Selection button in the dialog box Choose Assign Macro Assign Macro dialog box appears Click on macro to be assigned to button Then OK

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Click Modify Selection again Enter description into Macro name text box –Names the button –Becomes screen tip for the button

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Click the Modify Selection button again Choose Change Button Image Click on desired icon

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Toolbar Button image may also be edited

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Menu Macro command may also be added to a dropdown menu Click Tools, then Customize (use the Commands tab) Select Macros This time choose the Custom Menu Item and drag it to desired pulldown menu –Place in desired order in the menu

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Adding and Deleting a Macro from a Menu Custom menu item placed in desired menu Use the Modify Selection to change –Delete unneeded command –Name displayed –Add icon if desired

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Copying Macros to Other Workbooks Macro created and saved in one workbook –Cannot be used in another workbook unless original workbook is open –Excel must open that workbook Possible to avoid delay –Copy macro from parent workbook to active workbook Use Project Explorer window of Visual Basic Editor window

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Copying Macros to Other Workbooks With both macro source and macro destination workbooks open … –Click on Tools, then Macro, then Visual Basic Editor

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Copying Macros to Other Workbooks Visual Basic Editor Project Explorer window Click the + to show folder's contents

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Copying Macros to Other Workbooks Workbook folders shows macro from other project Currently active project Drag macro module to the destination project

The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved McGraw-Hill/Irwin Copying Macros to Other Workbooks Macro is now also an element of the second workbook When the macro is called from the newer workbook –Runs from that workbook –No need to wait for first workbook to open