Spreadsheets in Finance and Forecasting Presentation 9 Macros.

Slides:



Advertisements
Similar presentations
Introduction to Excel This class is “HANDS-ON” you will need to open up an excel spreadsheet and do examples as you go along. Students will be able to.
Advertisements

Excel Navigation. Instructions Use this PowerPoint presentation as you answer the Excel Navigation worksheet questions. Have Excel open also and use ALT.
Overview Lesson 1. Objectives Step-by-Step: Start Excel 1.Click the Start menu, and then click All Programs. 2.On the list of programs, click Microsoft.
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.
Beginning Excel To insert your company logo on this slide From the Insert Menu Select “Picture” Locate your logo file Click OK To resize the logo Click.
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.
Templates and Styles Excel Advanced. Templates are pre- designed and formatted spreadsheets –They provide consistency of layout/structure –They.
Word Processing First Steps
MODULE 5 B WORD PROCESSING. cont How to Add Colour to Your Microsoft Word Logo To add a coloured background to your shape, do the following: Make sure.
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
Microsoft Excel 2010 Chapter 7
Automating Tasks With Macros
SUNY Morrisville-Norwich Campus- Week 7 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
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.
SPSS 1: An Introduction to the Statistical Package SPSS Suzie Cro MRC Clinical Trials Unit.
PowerPoint: Tables Computer Information Technology Section 5-11 Some text and examples used with permission from: Note: We are.
Chapter 12: Recording Macros Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
1 Excel Lesson 3 Organizing the Worksheet Microsoft Office 2010 Introductory Pasewark & Pasewark.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
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
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Spreadsheets in Finance and Forecasting Presentation 7: Forms and Templates.
Spreadsheets in Finance and Forecasting Presentation 11 Visual Basic.
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.
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.
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 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
Lesson No:9 MS-Word Tools, Mail Merge and working with Tables CHBT-01 Basic Micro process & Computer Operation.
44221: Information Systems Lecture 8 (Week 10) Spreadsheet Automation By Ian Perry
INSERT BOOK COVER 1Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Office Excel 2010 by Robert Grauer, Keith.
Chapter 6 Generating Form Letters, Mailing Labels, and a Directory
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
Chapter 12: Recording Macros Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Excel CREATING A WORKSHEET AND CHART. Personal Budget Worksheet We will create a personal budget worksheet that shows you income each month and your expenses.
Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.
Name : Tatiana “Tania” Harrison Office : 216 Phone number: CWU page: Syllabus Name :
Key Applications Module Lesson 21 — Access Essentials
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 11 Organizing the Worksheet.
Using Microsoft Word & Excel §Open a new document in MS Word §Click on Tools & then Mail Merge l a dialogue box, like the one on this page, will appear.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
1. Chapter 15 Creating Charts 3 Charting Data in Word A chart or graph presents data visually. A chart depicts numeric data in a graphical format. If.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Excel Macros 1 Macros or, How to Automate Part of Your Spreadsheet or Worksheet.
Microsoft Excel ( XP-2003). Return to Table of Contents Table of Contents 1_ Introduction to ExcelIntroduction to Excel 2_ Overview of the Excel.
1 CA202 Spreadsheet Application Automating Repetitive Tasks with Macros Lecture # 12 Dammam Community College.
You’ll Make a spreadsheet which will be like a Mad Libs Game. These Are The Directions.
1. Using word you can create the document and edit them later, as and when required,by adding more text, modifying the existing text, deleting/moving.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
MS Excel INFORMATION TECHNOLOGY MANAGEMENT SERVICE Training & Research Division.
1 Word Processing Intermediate Using Microsoft Office 2000.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Using Macros Lesson.
Enlisted Association of the National Guard of the United States Data Extract Instructional Guide.
Excel Tutorial 8 Developing an Excel Application
June 17, 2009 Office 2007 Tips & Tricks.
Copyright © 2016 Pearson Canada Inc.
Microsoft Excel.
European Computer Driving Licence
Microsoft Excel 2003 Illustrated Complete
Chapter 7 Advanced Form Techniques
Microsoft Excel All editions of Microsoft office.
Advanced Microsoft Excel
Microsoft Excel 101.
Lesson 1 - Automating Tasks
Objectives At the end of this session, students will be able to:
Tutorial 10 Automating Tasks with Macros
Microsoft Excel 2007 – Level 2
Macro theory © EIT, Author Gay Robertson, 2019.
Day 1: Getting Started with Microsoft Excel 2010
Presentation transcript:

Spreadsheets in Finance and Forecasting Presentation 9 Macros

Objectives After studying this week’s material you will be able to: Use macros to automate formatting and printing Add controls to your worksheets which will enable users to : Switch between pages Update sections of a database Add selected charts to illustrate tables.

Using this Presentation The presentation is broken down into an Introduction and 5 separate sections. You should work through these in order, making sure that you have completed all the tasks in one section before going on to the next. A spreadsheet called Macro Examples accompanies this presentation. When you have finished all the sections in this presentation, you should go on to Formative Activity 7.

Introduction What are Macros? How do we create them?

What is a Macro? A macro is a piece of Visual Basic Code which executes a task or series of tasks. Macros are usually “recordings” of actions performed by the user.

What are Macros for? Macros are used to save time and effort. For example if you always format your tables in a particular way, you can use a macro to do this for you to save you pressing lots of buttons and remembering how you did it last time.

How do Macros work? We “record” Macros, in the same way that you would record an event with a video- recorder. You set press a “record” button, and Excel records all your actions. Later on you can “play back” the actions you recorded.

The Macro Examples Spreadsheet The spreadsheet Macro Examples accompanies this presentation. During this presentation we will develop examples of Macros to carry out the tasks in the following areas: 1. Printing 2. Formatting 3. Page Switching and Selection 4. Sorting 5. Worksheet Options

Macro Examples The spreadsheet Macro Examples will be used to develop some of the ideas. Load this spreadsheet now, so that you can do the activities. Action Point

Macro Toolbar Settings Before you do any work with macros you need to ensure that you have Excel configured correctly Click on View – Toolbars and Select the Visual Basic Toolbar TheVisual Basic Toolbar appears up here Action Point

Recording Macros The sequence for Recording Macros is: 1. START RECORDING: Click on the Blue Dot (Macro Toolbar) Name the Macro 2. RECORD ACTIONS: Carry out the Action you wish to record 3. STOP RECORDING: Click on the Blue Square (Macro Toolbar)

Testing, Testing … Just to test that your toolbar is working, try the following: Click on the Blue Square In the dialogue box, write Testing Click on OK Click on the Blue Circle Action Point NB. You may find that a separate little toolbar appears, with a Blue STOP square on it. If you have this, then you can use this instead of the button on the Macro toolbar. NB. You may find that a separate little toolbar appears, with a Blue STOP square on it. If you have this, then you can use this instead of the button on the Macro toolbar.

… Testing To see if your macro has recorded, click on Tools Macro Macros This dialogue box shows you that you have successfully recorded a macro called Testing Action Point

There’s nothing in it… If you have got this far, then you have successfully created your first macro. Unfortunately, it’s empty. We did not put any actions in it, so it doesn’t do anything. However, during the next section we will create a macro to carry out useful tasks.

Section 1 Macros for Printing

We will develop Macros to : Print out a selection Print out in Portrait form Print out in Landscape form

Examples: Printing The page is a set of tables documenting the number of student enquiries at the registry counter over a 4 week period. The first Macro we will produce will simply print out a single week’s table First of all, select the table for week 1 using the mouse. Action Point

Recording a Macro To record the macro, use the blue button on the Macro Toolbar Alternatively, Click on Tools Macro Record New Macro Action Point

Macro Recorder This Dialog Box appears. Change the Macro Name to PrintWeek Click on OK Action Point

Recording the PrintWeek Macro The Macro Recorder button should appear here or in the toolbar. This means that every action that you do from now on is being recorded.

The Print Dialog Box Click on File – Print The Dialog box (left) appears. We will print the selection. When you press OK, the printing will take place. Action Point

The PrintWeek Macro Now click on the The square blue Macro Recorder button. The recording has now stopped, and PrintWeek is now a Macro, and is now a new Excel command. Action Point

Running the Macro Highlight the Week 2 table with your cursor, and then: Select Tools- Macro- Macros The dialog box right shows that you have recorded the Macro. Select this macro, then click on Run. This will print out the table you have selected. Action Point

Assigning the Macro to a Button Bring the Forms toolbar onto the screen. (View- Toolbars- Forms) From the Forms toolbar, select a Button, and put it on the page at around H This dialog box appears. Assign the Macro PrintWeek to the button by selecting it. Click OK Action Point

Renaming the Button Right click on the button and Edit Text. Rename the Button Print Selection. Action Point

Printing another section Now highlight Week 4, and press the button. This time week 4’s text is printed. Action Point

Another print button Highlight Week 1 and Week 2. Select Tools- Macro-Record New Macro Name the Macro PrintPortrait Click on OK Action Point

PrintPortrait Macro Click on File- Page Setup Select Fit to 1 page wide by 1 page tall Click on OK Action Point

PrintPortrait Macro Now Click on File- Print Select Selection Click on OK Then click on the Blue Button on the Macro Recorder to turn it off. Action Point

Finishing Off Attach the Macro PrintPortrait to a button. Call this “Portrait”. Check that it works by selecting weeks 3 and 4, and printing off. Action Point

Printing Challenge Create a button called “Landscape” which runs a Macro PrintLandscape that prints the selected area in Landscape form. Action Point

Section 2 Macros for Formatting

We will create a macro which uses an on-screen template as a model for the formatting of a number of similar tables.

Formatting Switch the Page to Formatting, and move the cursor over to the right, at around column Q Select and highlight the block of cells Q4 : V12 Action Point

Using Auto Format Click on Format – Auto format, and this menu box appears. Scroll down through the examples until you find this one: Click on OK Action Point

The Formatted Text This is the result of the Auto- formatting of the text you selected. Now scroll the cursor left and position it at cell H2. Action Point

The Formatting Macro Click on Tools-Macro- Record New Macro Call the new Macro FormatWeeks Start Recording Move the cursor to the right and highlight cells Q4:V12 Copy this block of cells Action Point

Formatting the tables Position the cursor over cell B4 and click on Edit-Paste Special – Formats Click OK Repeat this at cells B15, I4 and I15. Now click on cell H2 Stop Recording Action Point

Adding a Button Add a button at around cell H6 Assign the Macro FormatWeeks that you have just recorded. Call the Button Format Action Point

Trying a different Format Now move over to cells Q4 to V12, and experiment with a different format. You could try one of the auto formats, devise your own or modify an auto format like this one: Action Point

Formatting all the tables Clicking on the button will now transfer your formatting over to all the tables Action Point

Section 3 Macros for Page Selection

Page Selection We will create macros that will Switch back and forth between two pages Select pages in a workbook from a Menu

Switching Pages Examine Page 1 and Page 2 of the Macro Examples Spreadsheet. On Page 1, record a Macro “Page2” which turns to Page 2. Create a button on Page 1 called “Page 2”, which, when you press it takes you to Page 2. Action Point

Switching Pages On Page 2 of the Examples Spreadsheet, create a button called “Page 1”, which, when you press it takes you to Page 1. Action Point

Options On the Page Selection sheet, there are two option buttons. Right Click on each of these in turn to attach the appropriate Macro Code so that they do exactly what it says on the label! Action Point

Section 4 Macros to Sort Data

Sorting We will create Macros to sort a table on a particular row or column.

Sorting Macros Switch to the page called Sorting. Record a Macro called Sort 1 Highlight the table as shown here, cells C4 to G10 Action Point

Sorting Macros Now click on Data and Sort. Select Options and when the second dialogue box appears, select click on Left to Right. Click Ok, and in the first box, select Row 5. Click on OK to finish. Now stop recording. Action Point

The Sorting Buttons Add 6 separate buttons to the spreadsheet which will be assigned to macros Sort1, Sort2 etc., and which sort the table according to each of the rows. Create These Action Point

Section 5 Macros to change the look of the Worksheet

Worksheet Options The final two macros will change the look of the worksheet itself.

Two More Macros On the final page called Blank Page, create two macros which: 1.Removes Gridlines 2.Removes the Border Frame You will need to select Tools-Options, which brings this menu up. Action Point

The Final Two Macros Finally add two buttons which switch on the number frame and the gridlines. Action Point

The Next Steps Formative Activity 10 takes you through more examples of how macros can be used These will be developed using the spreadsheet Cornershop Revisited Macros include: Updating a database Switching within a sheet Creating Charts