Presentation is loading. Please wait.

Presentation is loading. Please wait.

G042 - Lecture 15 Excel Macros Mr C Johnston ICT Teacher www.computechedu.co.uk.

Similar presentations


Presentation on theme: "G042 - Lecture 15 Excel Macros Mr C Johnston ICT Teacher www.computechedu.co.uk."— Presentation transcript:

1

2 G042 - Lecture 15 Excel Macros Mr C Johnston ICT Teacher www.computechedu.co.uk

3 Session Objectives Understand what a macro is and how they can be used to create more efficient spreadsheets, Created macros which satisfy the marking requirements of task d.

4 Macro Overview A macro is a computer program which automatically carries out a number of tasks one after another. As macros carry out several tasks one after another they cut down on the number of key presses required so make spreadsheets faster. Luckily you don’t need to program the macros there is a handy recorder which records the key stokes for you. To run a macro you can either setup a keyboard short cut or add a button.

5 Recording A Macro Office 2003 1.Go to Tools, Macro, Record New Macro… 2.Give the macro a name (no spaces) and assign a short cut key 3.Carry out the tasks on the spreadsheet which you want the macro to perform. Press the stop button to finish. 1. 2. 3.

6 Recording A Macro Office 2010 1.Select Macros > Record Macro… from the view ribbon 2.Give the macro a name (no spaces) and assign a short cut key 3.Carry out the tasks on the spreadsheet which you want the macro to perform. When finished Goto Macros > Stop Recording from the view ribbon 2. 1. 3.

7 Run Macros From A Button Office 2003 1.Go to View, Toolbars, Forms to display the forms toolbar. 2.Click on the button and draw where you want the button to be on the worksheet. 3.Select the macro from the list to be triggered by the macro. 4.Click on the button to rename it. 1. 2. 3.

8 Run Macros From A Button Office 2010 1.Enable the developer ribbon by right clicking on a blank piece of the ribbon and selecting customize ribbon and placing a tick in the developer ribbon box, 2.From the Inset icon on the developer ribbon select Button(Form Control) and draw it in the required position on the screen, 1. 2.

9 Run Macros From A Button Office 2010 3.Once you have drawn your button, a window will appear – select the macro which you want it to trigger, 4.Right click on the button to give it a suitable name. 3.

10 Criteria For band 2 of task d you need to make some macros which do something useful to assist with the input of data (later) and processing / outputting of results. It would also be useful (although doesn’t gain many marks) to produce a menu system.

11 Possible Macro Use 2009 Ideas generated by 12A 23-03-2009

12 Debug Error If you try to edit graphs (titles, formatting etc.) whilst recording a macro, the macro when run will probably bring up a debug error. This is because the name of the graph created whilst recording the macro will be different to ones created when the macro is run so excel doesn’t know what to do, The solution is to edit the macro code so it has a fixed name which can be referenced by the code. Chart 3 is referenced in the code however the macro this time has made Chart 15

13 Debug Error Add in code above the highlighted error to give the chart a name: Activechart.Parent.Name = “[name of chart]” Example:


Download ppt "G042 - Lecture 15 Excel Macros Mr C Johnston ICT Teacher www.computechedu.co.uk."

Similar presentations


Ads by Google