Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all.

Slides:



Advertisements
Similar presentations
Introduction to Macro Introduction to Visual Basic for Application Recording a Macro Looking at the code of Recorded Macro.
Advertisements

Using Macros and Visual Basic for Applications (VBA) with Excel
Developing an Excel Application
Tutorial 8: Developing an Excel Application
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.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
Microsoft Excel 2003 Illustrated Complete with Excel Programming.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
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)
1 CA203 Presentation Application Customizing PowerPoint Lecture # 15.
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.
Other Features Index and table of contents Macros and VBA.
1 Macros Presented by Maria G. Martinez. 2 What's a macro?  Macro - set of computer instructions that you can record and associate with a shortcut key.
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.
Access Tutorial 10 Automating Tasks with Macros
Introduction to Excel VBA University of Chicago Graduate School of Business Introduction to Computer Based Models Bus Mr. Schrage Spring 2003.
Project 9 Using Visual Basic for Applications (VBA) to Customize and Automate Excel Jason C. H. Chen, Ph.D. Professor of Management Information Systems.
1 CS 106 Computing Fundamentals II Chapter 17 “Introduction To VBA” Herbert G. Mayer, PSU CS status 6/30/2013 Initial content copied verbatim from CS 106.
VBA (Visual Basic for Applications) What is Excel, just a spreadsheet? Time for Demos...
11 10/10/2005 BAE Spreadsheet Macros (Visual Basic for Applications) Slides to accompany an in-class demo of spreadsheet technique: Macro Programming.
© 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.
NetTech Solutions Using Advanced Tools Lesson 5. NetTech Solutions Objectives Use Slide Finder Use the Format Painter Understand the purpose of 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-
Microsoft Excel Macros & Excel Solver (IENG490)
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.
Just Enough AutoCAD Chapter 9 Creating Text Adding and Formatting Text in AutoCAD Understanding Text and Scale Using Styles to Organize Your Fonts Adding.
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Exploring Microsoft Office XP - Microsoft Word 2002 Chapter 71 Exploring Microsoft Word Chapter 7 The Expert User: Workgroups, Forms, Master Documents,
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Chapter 12: Recording Macros Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Just as there are many human languages, there are many computer programming languages that can be used to develop software. Some are named after people,
Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.
Using Visual Basic for Applications in Microsoft Project Sean Vogel.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 8 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 8 Creating.
There are seven main components of a database in Access 2000: Tables. Use tables to store database information. Forms Use forms to enter or edit the information.
Creating Macros in Excel Adding Automated Functionality to Excel & Office Applications.
Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl.
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.
Access Queries and Forms. Adding a New Field  To insert a field after you have saved your table, open Access, and open the table  It is easier to add.
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.
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.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Excel Tutorial 8 Developing an Excel Application
Exploring Excel Chapter 7 Automating Repetitive Tasks: Macros and
Mail Merge And Macros in MS WORD
Microsoft Excel 2003 Illustrated Complete
Introducing VBA Macros
Creating Macros in Excel
Exploring Microsoft Excel
Macro.
Lesson 1 - Automating Tasks
Microsoft Office Excel 2003
Microsoft Excel 2007 – Level 2
Presentation transcript:

Macros n Macros are little programs that you can create to automate particular tasks that you may want to execute more easily than having to specify all the steps yourself every time you want to perform that task. n Macros can be created for use in any Microsoft Office application. n Here we consider macros for Excel.

n Macros are actually written in a programming language called VBA (Visual Basic for Applications). n But simple macros can be created by just performing the operations once and letting the macro recorder in Excel translate your actions into VBA. n To create a macro this way, use the Tools => Macro => Record New Macro… dialog box.

A macro example n We create a macro that performs a specific job on the following Excel list:

n What we want it to do is to identify all the records for managers and display them in red. (Imagine that there are thousands of records, so we don’t want to do this manually.) n We will give this macro the name HighlightManagers. n Furthermore, we will make it so that to run it we can simply use the keyboard shortcut Ctrl+h.

n The approach we take is to start out creating a macro that highlights any record in red. n Later we will modify it by adding additional VBA code. n We start out by making any cell in the first column of our data, say A2, the active cell. n Then we start the Macro Recorder:

n In the Stop Recording toolbar we first make sure the Relative Reference button is pushed in. n Then we click and drag to select cells A2:F2. n Then we click the arrow next to the Font Color button on the formatting toolbar and select Red. n Finally, we click the Stop Recording button.

Stop Recording toolbar Relative Reference button

n All this macro does is change the font color to red for 6 cells – whatever cell happens to be the active cell when it is run and the 5 cells to its right in the same row. n We use the Visual Basic Editor (which we can bring up by Alt+F11) to display the VBA code for this macro:

n Now we add VBA code so that the macro – starts with the first record and proceeds through all the records, – checking to see that record is that of a manager and only changing the font color if it is. n For convenience, we have named cell A2 FirstRecord.

n Once we have this macro created correctly (possibly taking advantage of VBA debugging features to get it right) we can then apply it to our list: