Sei sulla pagina 1di 16

MACROS

All jobs and fields require some repetitive steps. Excel help us automate some of those repetitive steps and that way makes our lives easier, so we can get the work done quickly and have more leisure time. MS Excel, allow you to create macros so that you can enter a single character or word to perform a whole series of actions.

What is a macro?

Macros are symbols, names, or keys that represent a list of commands, actions, or keystrokes.

STEP 1
Go to Start>Programs>Microsoft office>Microsoft Excel to open the application. Then, go to Start>New to open a new spreadsheet. Go to File>Save as and save the new file before going further.

STEP 2

Go to Tools>Macro>record new macro

STEP 3
A pop up window named Record Macro appear. will

There are 4 points of interest:

Name - Type the name of your macro. Please note that the first character of the macro name should be a letter, then you can use any letter, number or underscore but with no spaces.

Shortcut key - (optional) this has to be a letter, we have used h, so in our example the macro will run every time we hold down the CTRL key and press the H key.

Store macro in - This would normally be the workbook you are working on (this workbook), but you can save macros into a personal macro workbook.

Description - Here you can enter a description of the macro for your benefit.
When you have finished filling in the information click the OK button to start the macro recorder.

STEP 4

In this step, you will record the macro. at any time you can stop recording the steps for the macro.

STEP 5

Go to File>New to open a new spreadsheet. go to Tools>Macro>Macros and select this macro run it. and

Exercise 1 Employee details in a firm


1. Click in any cell. 2. Click Tools, Macro, Record New Macro 3. Macro Name = emp

4. Short cut = Ctrl + e


5. Store Macro In = Personal Macro Book 6. OK 7. Click the Relative Reference button on the Record Macro toolbar 8.enter the details 9. name,salary,..etc 10 click ok 11open a new file, Click on an empty cell, then press Ctrl+e

Exercise 2 90 Days
1. Click in any cell. 3. Macro Name = days 4. Short cut = Ctrl + d

90 Days This macro will create and format the days of the week.

2. Click Tools, Macro, Record New Macro

5. Store Macro In = Personal Macro Book 6. OK 7. Click the Relative Reference button on the Record Macro toolbar 8. Type Monday 9. Use the fill handle to drag across 6 more cells thereby completing the series to Sunday 10. Click Format, Cells

11. Click the Alignment tab


12. Horizontal & Vertical alignment = Center 13. Orientation = 90 degrees 14. Click the Font tab 15. Font = Bold, 12 16. Click the Border tabs 17. Click between each Text block to place vertical lines between cells 18. Click OK 19. Click on an empty cell, then press Ctrl+d

Exercise 3 Automatic Custom Header & Footer


This macro will create a custom header and custom footer which includes the

file name, page number and author.


1. Click Tools, Macro, Record New Macro 2. Macro Name = CustomHF 3. Shortcut = Crtl+Shift+C 4. Click OK the macro begins recording 5. Click the Relative Reference button on the Record Macro Toolbar

6. Click File, Page Setup


7. Click the header/footer tab 8. Click Custom header 9. Left = date Center = tab Right = filename 10. Click OK

11. Click the down arrow under footer


12. Select Page 1 13. Click OK, then stop recording the macro

Potrebbero piacerti anche