Setting up the Spreadsheet Structure

Total Page:16

File Type:pdf, Size:1020Kb

Setting up the Spreadsheet Structure

MACROS

A macro is a program that stores a series of Microsoft Excel commands so they can be executed as a single command through a button or a keyboard shortcut.

You are going to set up a simple spreadsheet to practice recording macros for different purposes, & creating buttons to which you will assign the macros.

Setting up the spreadsheet structure . Open a new spreadsheet workbook. . Save it in your ICT folder as MacroPractice. . Rename the sheet tabs at the bottom of the screen as Cover, Income, Outgoings. . Working on the Cover page you are going to record a macro that will move you from the Cover to the Income page.

Checking macro security settings . Check your macro security levels by selecting Tools  Macro  Security.

. Make sure the level is set at medium. If it’s not, change it, save your spreadsheet, close it, re-open it, & when prompted ‘Enable Macros’.

Recording a macro . You are now ready to record a new macro. Select Tools  Macro  Record new Macro. Give it the name Income. (Macro names do not allow you to use spaces, so they must be just one word:

Page 1 of 3 . The small Recording box will appear: . You will now record all the keystrokes or mouse movements you need to move to the Income sheet. . Select the Income sheet tab at the bottom of the screen, on the Income sheet, click in cell A1. Press the small blue square to stop recording.

Creating a button . Return to the Cover page. You are now going to create a button for this macro. . Display the Forms toolbar (View  Toolbars  Forms). Select the Button tool, & draw a button:

. When prompted assign your Income macro to the button:

. Change the label on the button to be Income.

. Test out your macro.

Page 2 of 3 More macros . Create another macro with a button on the Cover page to go to the Outgoings sheet. . Now create a macro with a button to return from the Income page to the Cover page. . If you copy & paste this button onto the Outgoings sheet, does it still work?

Macro to clear figures . On the Income page enter the following data:

. Format the numbers as Currency. . In row 4 create formulae to work out the total Income for each week. . You are now going to create a macro to clear the income figures in rows 2 & 3. . Start recording a new macro (Tools  Macro  Record New Macro). . Call it ClearFigures. . Highlight from cell B2 to E3, delete these values. . Stop recording the macro. . Create a button on the income page, assign your ClearFigures macro to it. . Change the text on the button to read ‘Clear Figures’. . Put more values into cells B2 to E3. . Test out the new macro.

Using shapes & autoshapes as buttons . Return to the cover page. Delete your Income button. . Draw a circle, fill it with a colour. . Right click it & assign your Income macro to it. . Add the word Income to the new button, format the text. . Test the button.

A macro to print . To set up a macro & a button to print your figures, you need to start the macro recording process, and call your macro ‘Print’. . Highlight from A1 to E4. From the main menu select File  Print Area  Set Print Area. . From the main toolbar choose Page Preview . Click on Set-Up, change the page orientation to Landscape. Add a footer with the company name (Angels Theatre Company) & the date in it. . Select print. . Back on the Income page, clear the print area, by selecting File  Print Area  Clear Print Area. . Stop the macro recording process. . Create a button called ‘Print Figures’, and assign the macro to it. Page 3 of 3

Recommended publications