Microsoft Excel 2007 © Wiley Publishing. 2007. All Rights Reserved. The L Line The Express Line to Learning L Line.

Slides:



Advertisements
Similar presentations
Microsoft Excel 2007 The L Line The Express Line to Learning L Line
Advertisements

© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
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
Tutorial 7: Developing an Excel Application
Developing an Excel Application
Tutorial 8: Developing an Excel Application
© 2002 ComputerPREP, Inc. All rights reserved. Excel 2000: Customizing Excel and Using Macros.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
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.
Microsoft Excel 2003 Illustrated Complete with Excel Programming.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Macros Excel built-in functions are great but limited Macros are a means for the user to define new functions A macro is a single command that automates.
Using the Visual Basic Editor Visual Basic for Applications 1.
Microsoft Excel 2003 Illustrated Complete Excel and Advanced Worksheet Management Customizing.
Adding Automated Functionality to Office Applications.
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)
Macros in Excel Intro to lab 1. Macroinstructions Macro is recorded in VBA module sequence of Excel operations Macros can automate tasks in Excel Macro.
Excel Lesson 14 Creating and Using Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
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.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
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.
Customizing Microsoft Project
Saeed Ghanbartehrani Summer 2015 Lecture Notes #2: The Visual Basic Editor The Visual Basic for Applications Programming Language IE 212: Computational.
With Microsoft Excel 2007 Comprehensive 1e© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2007 Comprehensive.
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.
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-
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 7Automating, Customizing, and.
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
OV Copyright © 2011 Element K Content LLC. All rights reserved.  Create a Macro with the Macro Recorder  Edit a Macro  Debug a Macro  Customize.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.
OCC Network Drives  H:\  P:\ 
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Chapter 9 Macros And Visual Basic For Applications.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Introduction to Microsoft Excel Macros COE 201- Computer Proficiency.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
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 Excel 2002 Using Macros Lesson.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 12 Introducing Visual Basic for Applications Microsoft Office Excel.
Excel Tutorial 8 Developing an Excel Application
June 17, 2009 Office 2007 Tips & Tricks.
Outline In this module, the following topics will be covered:
Microsoft Office Illustrated
Excel VBA Day 3 of 3 Tom Vorves.
Microsoft Office Illustrated
Microsoft Excel 2003 Illustrated Complete
Exploring Microsoft Excel
Macro.
Lesson 1 - Automating Tasks
Microsoft Excel 2007 – Level 2
Presentation transcript:

Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line

Programming Excel: An Introduction to VBA and Macros 15 Running your first macro Creating your own macro Activating and using the Developer tab Debugging macros in the Visual Basic Editor Adapting a macro Adding a macro to the QAT Looking at other uses for macros Understanding trusted locations and trusted sources Stations Along the Way

Why Use Macros? Macros enable you to automate a process you perform in Excel: A series of steps you perform regularly A complicated process you need to be able to repeat exactly each time They make it easier to do your work Record your keystrokes and then use VBA to fine-tune macros (or create them from scratch)

Sample Macro Code This macro code performs a progression First line defines name; lines that begin with quotation marks are comments; the macro follows Sub progression1() ' ' This macro takes two numbers from consecutive cells in ' column C and finds the next 10 numbers in the progressive ' series ' For I = 3 To 13 nextvalue = "c" & I Range(nextvalue).Select ActiveCell.FormulaR1C1 = "=R[-2]C+R[-1]C" Next I End Sub

Creating a Macro Easiest method is to record the macro; Excel watches what you do and remembers the steps Access the Record Macro command from the View tab (Macros button) Name the macro, assign shortcut key, and specify location and description Record the macro and then stop recording when macro steps complete

Tips for Creating Macros Practice what you want the macro to accomplish; jot down steps beforehand Give macros a descriptive name Use an unassigned shortcut key Step through the macro to debug it Edit macro code or re-record macro Save macro file in.xlsm format

Using the Developer Tab More options for working with macros Developer tab doesn’t display by default; you must activate it Select “Show Developer Tab in the Ribbon” in the Excel Options window (Popular options) Developer tab displays in the Ribbon with four groups: Code, Controls, XML, and Modify

Viewing Code in the Visual Basic Window Open file containing macros and choose Visual Basic on Developer tab Visual Basic window has four areas: Command menus across the top Top-left window shows project elements Bottom-left window shows properties Large window on right shows VBA code Double-click a module to see code

Debugging Macros Most code includes errors to debug: Syntax – typos and command errors Logic – Excel doesn’t understand coding Scope – code works, but not optimally Run macro with error; Visual Basic Editor opens and highlights error Note type of error in message box Use Debug button and Help info Fix coding and rerun until error-free

Adapting a Macro Control what a macro does by: Asking for user input to determine path Basing macro path on a condition Placing processing in a repeating loop that controls the code Add helpful comments for users: Describe in detail what the macro does Explain limits, conditions, variable names

Adding a Macro to the QAT Add a button to the QAT to quickly access your macro Click Customize in the Excel Options window and choose Macros category Specify current file or all files Select macro name and add to QAT Click Modify to add custom icon Click button in QAT to run the macro

Other Uses for Macros Creating complex charts Performing complicated computations Applying detailed worksheet formatting Simplifying data entry Opening and cleaning text and CSV files Writing VBA applications that run on top of Excel

Trusted Locations and Trusted Sources Trusted locations contain code that is trusted from any source Includes default template locations, user startup folders, Excel add-ins location Use Trust Center to add trusted locations Trusted sources include trusted publishers and companies who develop coding and use certificates to verify their identity

Discussion Questions Why do you need to enable macros? Which format should you use when saving Excel files with macros in them? Why would you use the Developer tab? Why would you want a macro to contain an If...Then statement? Why would you want a macro to contain a loop?

Discussion Questions (cont.) Where do you debug macros? What is the difference between a syntax error and a scope error? Why should you trap errors? How do you add a macro to the QAT (Quick Access Toolbar)? What is a trusted source?