11. Visual Basic Macro Recorder. Open Excel Click File -> Save As.

Slides:



Advertisements
Similar presentations
Part 3. Enter Data Enter Simple Formulas – Basic Arithmetic Symbols Select Cells – Click/Drag, Ctrl-Click, Shift- Click Format Cell Contents – Bold, Italic,
Advertisements

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
Loading Excel Double click the Excel icon on the desktop (if you have this) OR Click on Start All Programs Microsoft Office Microsoft Office Excel 2003.
Microsoft Office Excel 2013 Core Microsoft Office Excel 2013 Core Courseware # 3253 Lesson 8: Macros, Importing and Exporting Data.
Excel Lesson 1 Excel Basics. Task 1  Goals  Learn about Excel  Start Excel  Explore the Excel screen  Explore the Excel workbook  Explore the worksheet.
EXCEL Spreadsheet Basics
COE201 – Computer Proficiency Mr. Hamze Msheik
MICROSOFT OFFICE 2013 EXCEL 1. 2 File Tab 1 Title Bar 5. Group 7 Name Box 6 Active Cell 8 Formula Bar 4 Ribbon 9 Column 10. Row 11 Sheet Tabs 12 View.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
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.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
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.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
Spreadsheet. Objectives Create a new blank workbook. Create a new blank workbook. Identify user interface elements that you can use to accomplish basic.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
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.
Excel Project 5 Creating, Sorting, and Querying a List.
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.
CITY UNIVERSITY / Vysoká Škola Manažmentu.:MG Information Systems :. © Martina Cesalova, 2005 MS FRONTPAGE 1 1.Open FrontPage – View -> Page 2.Open.
Excel Lesson 2 Business Forms. Task 1  Goals  Format cell data  Apply and modify cell styles.
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-
12. Visual Basic If Statements and Do Loops. Open 12b-datastart.xlsm.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Project 5 Creating, Sorting, and Querying a List.
European Computer Driving Licence Syllabus version 5.0 Module 4 – Spreadsheets Chapter 22 – Functions Pass ECDL5 for Office 2007 Module 4 Spreadsheets.
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
Creating a Web Site to Gather Data and Conduct Research.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
MICROSOFT WORD 2007 INTERMEDIATE/ADVANCED. CREATE A NEW STYLE BASED ON A SELECTED TEXT HOME tab > STYLES group dialog launcher > at the bottom of the.
Remember…  Please do not…  Change the background.  Change the icons.  Change the font. Use Times New Roman (size 12 font).  Use color. We cannot print.
INTEGRATION TO GENERATE MOTIVATION TO LEARN INTEGRATION TO FOSTER CREATIVITY.
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.
Microsoft Publisher 2010 Chapter 7 Advanced Formatting and Merging Publications with Data.
Chapter 1 Creating a Worksheet and a Chart
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Chapter 9 Macros And Visual Basic For Applications.
Remember…  Please do not…  Change the background.  Change the icons.  Change the font. Use Times New Roman (size 12 font).  Use color. We cannot print.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Remember…  Please do not…  Change the background.  Change the icons.  Change the font. Use Times New Roman (size 12 font).  Use color. We cannot print.
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.
Microsoft Excel Prepared by the Academic Faculty Members of IT.
Chapter 28. Copyright 2003, Paradigm Publishing Inc. CHAPTER 28 BACKNEXTEND 28-2 LINKS TO OBJECTIVES Table Calculations Table Properties Fields in a Table.
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.
ITE101: Fundamentals of Computing Associate Dean College of Science & Technology Lecturer : Mr. Teav Chhun Nan, MSc Master of Electronics and Telecommunication.
To create text styles click on Home >> Tab under Change Styles
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Chapter 11 Enhancing an Online Form and Using Macros Microsoft Word 2013.
Lecturer: Dalia Mirghani
Excel Tutorial 8 Developing an Excel Application
June 17, 2009 Office 2007 Tips & Tricks.
After completing this lesson, you will be able to:
Microsoft Excel.
Chapter 7 Advanced Formatting and Merging Publications with Data
Excel 1 Microsoft Office 2013.
Lesson 1 - Automating Tasks
Microsoft Excel 2007 – Level 2
Add Background Style Click the slide or slides that you want to add background style Click Design Tab Click Down arrow in the Themes group.
Presentation transcript:

11. Visual Basic Macro Recorder

Open Excel

Click File -> Save As

Save As a Excel Macro-Enabled Workbook

Click File -> Options

Click Customize Ribbon

Tick Developer

Click OK

Select Developer menu

Macro Recorder A job may require you to do the same repetitive task every day in Excel You can make Excel complete some of these tasks automatically by recording a macro All you have to do to repeat the action is to click a button

Formatting Cells If you are creating tables of results you may need to format them in a particular way e.g. font, border, background Rather than doing each step repeatedly we can record the actions once, and then make Excel repeat them

Type in this table of information

Highlight these cells

Click Record Macro

Macro name: Format Table Shortcut key: Ctrl+o

Click OK

Every action we take from now on will be recorded until we click Stop Recording

Right-click with mouse and select Format Cells

Click Font and select Times New Roman, Bold, Size 14 and Colour Dark Blue

Click Border and then the Double Lines

Select Top and Bottom borders

Click OK

Click Stop Recording

Click Visual Basic

Select Module 1

Excel has recorded all of the tasks which you have just completed, and written a program

You can make changes to this program by typing into the script

Click Close

Type in the following table

Highlight the new table

Press Ctrl + o This is the shortcut key we assigned to our macro

The macro is run and all of the tasks are completed automatically

Challenge Go into Visual Basic editor Change the Font Name to “Verdana” Change the Font Style to “Italic” Change the Font Size to 12 Save and Close the Visual Basic editor Select the table again and press Ctrl+o to reformat the table

Trial and Error The best way to learn specific commands in Visual Basic is to use the Macro Recorder You can look at the code that is generated and then try to make some changes

Stock Screener By using some creativity you can create complex programs using Visual Basic In the following example we will download data from Yahoo Finance, and then filter it to find companies with a low P/E ratio

Select Sheet 2

Click Record Macro

TypeMacro name: StockScreener Shortcut key: Ctrl + l

Click OK

Click Data -> Import From Text

Type in the following web address

Click Open

Click Cancel if any passwords are requested

Click Next

The original data is separated by commas so tick Comma

Click Next

Click Finish

Click OK

Click Cancel if any password is requested

Imports the data which we asked for

Select cell A1

Select Insert -> Insert Sheet Rows

Type in the following headings

Select Column D

Click Data -> Filter

Click on Dropdown box, then Number Filters -> Less Than …

Choose PE less than 20 and click OK

Filters data to show companies with a P/E less than 20

Click Developer -> Stop Recording

Click Visual Basic

View the code for the stock screener

We can edit which companies we want to download by changing the ticker symbols

Replace MSFT+GOOG with AXP+DIS+GE+KO+MCD+PFE

Click Save and Close

Select Sheet 3

Press Ctrl+l to run macro with new companies

Shows which companies have a P/E under 20

Challenge Create a new sheet Edit the Visual Basic code to download information for the following tickers: – INTC – JNJ – JPM – KO – XOM Change the filter criteria to select companies with a dividend yield less than 3