This is the extracts of an presentation that I had prepared for an Training on Creation Simple MS Excel Macros.
Link to the file: Excel Macro Training.ppt
Introduction
Agenda
There are 2 ways to create a a macro: You can record it, or can build it by entering instructions in a module. Either way your instructions are encoded in the programming language MS VBA.
Overview
The overall process for recording a macro consists of three steps.
Using the Macro Recorder
Rather than type macros character by character, you can have Excel create a macro by recording the menu commands, keystrokes, and other action needed to accomplish a task.
Lets see how to create a macro to draw a boarder around a selected area.
Running a Macro without Using a Keyboard Shortcut
Behind the Scenes: The VBA Environment
Adding Code to an Existing Macro
1. Choose Tools, Macro, Record New Macro. Excel presents the Record Macro dialog box. In the Macro Name box, enter MacroTemp and click OK. Excel displays the Stop Recording toolbar.
2. Choose Format, Cells, and click the Font tab. Select Trebuchet MS, 10-point, and Bold Italic. Then click OK to apply the formats.
3. Click the Stop Recording button on the Stop Recording toolbar.
4. Choose Tools, Macro, Macros. In the Macro dialog box, select MacroTemp and click Edit.
5. A window appears that contains the original macro you recorded plus the MacroTemp macro.
6. Select all the code inside the macro—from the line beginning With through the line beginning End With—and then choose Edit, Copy.
7. Scroll up to display the “Border” macro
8. Click at the penultimate that contains this statement:
End Sub
9. Press Enter to create a blank line. Then position the insertion point at the beginning of the blank line.
10. Choose Edit, Paste.
11. Scroll back down and delete the entire MacroTemp macro, from the Sub statement to the End Sub statement.
To test the macro, return to Excel (press Alt+F11 or select the Excel button on the taskbar). Clear the company name and address that you entered earlier when you recorded the macro. Then press Ctrl+Shift+A.
Using the Personal Macro Workbook
Going On from Here
Conclusion
Audit: Annual event where CAs come in and officially point out mathematical errors in your spreadsheets.
Auto-Save: What your spreadsheet does immediately after you make a huge mistake and just before you press Undo. If you have a sound card, you may be able to hear your program laughing at you.
Backup: Many spreadsheet programs will automatically create a backup of your current file. This gives you two copies of the same non-balancing file.
Cell: This is where you spend the rest of your life when your boss has made you spend several nights at the office until a large project is finished. The cell will have bars if you are a type A personality, and will be padded if you are type B.
CIRC: See Circular Reference.
Circular Reference: See CIRC.
Cursor: What one becomes who sits in front of the same spreadsheet that won't balance for more than 2 hours.
Cut, Copy and Paste: What you do with your printouts to get something intelligible. See Table.
Format: Visual enhancements to spreadsheets to draw attention away from inaccuracies.
Formula: Mathematical equations that display as ERR, DIV/0 or N/A.
Frame: What you do with your first error free spreadsheet. (Contact MENSA if you did this in less than 1 month.)
Goal Seek: When you know the answer (because you did it on your calculator in 10 seconds) but can't get the spreadsheet to work right. Also known as Backsolve.
GPF: What happens when you finally get your spreadsheet working correctly. But before you've had a chance to save it.
Group Mode: The ability to populate a group of worksheets with the same error, saving yourself lots of time.
Import: Ability to get huge amounts of data from an outside source allowing you to create hundreds and thousands of rows of seemingly meaningful data.
Invalid File: Error you get once you have finally perfected your spreadsheet and attempt to load it the next day to print. Only occurs if you don't do regular backups.
Link: Ability to get erroneous information from a file without actually loading it into memory.
Macro: Automated mistakes, made at the speed of light.
Print Preview: Lets you know if your printout will be Portrait or Landscape. Information on the screen bears no resemblance to what actually prints out.
Solver: Spreadsheet tool usually used by geeks who want to bring their computer's processor to its knees. No valid data ever obtained, but it makes you feel good that you forced your computer to think for more than half a second.
Sort: Fast method to randomize a column of formula references.
Table: Furniture used to spread out all of your papers and arrange them so they look like what is on the screen. See Cut, Copy and Paste.
Titles, Horizontal: Headings printing on the left margin you wanted at the top of your document.
Titles, Vertical: Headings printing on the top margin you wanted down the left side of your document.
Undo: Feature that enables you to revert from the current spreadsheet with 47 error values to where you were before you made your mistake when you only had 13 errors.
What-If Analysis: The process of automatically generating detailed projections for hundreds of different scenarios - not one of which has a snowball's chance in hell of being even remotely possible.
Window: Ability to look at multiple pieces of multiple files simultaneously. While this may sound attractive, you must have at least three hands to navigate these windows to successfully build formulas - unless you have a mouse, then you need four hands.
Wizard: Interface enhancements that enable you to create complex and sophisticated errors at unprecedented speeds.
WYSIWYG: What You So Intensely Wish You'd Got
Source: E-mail forward
It’s not difficult?
All you have to do is to be:
1. A friend
2. A companion
3. A lover
4. A brother
5. A father
6. A master
7. A chef
8. An electrician
9. A carpenter
10. A plumber
11. A mechanic
12. A decorator
13. A stylist
14. A sexologist
15. A gynecologist
16. A psychologist
17. A pest exterminator
18. A psychiatrist
19. A healer
20. A good listener
21. An organizer
22. A good father
23. Very clean
24. Sympathetic
25. Athletic
26. Warm
27. Attentive
28. Gallant
29. Intelligent
30. Funny
31. Creative
32. Tender
33. Strong
34. Understanding
35. Tolerant
36. Prudent
37. Ambitious
38. Capable
39. Courageous
40. Determined
41. True
42. Dependable
43. Passionate
WITHOUT FORGETTING TO:
44. Give her compliments regularly
45. Love shopping
46. Be honest
47. Be very rich
48. Not stress her out
49. Not look at other girls
AND AT THE SAME TIME, YOU MUST ALSO:
50. Give her lots of attention, but expect little yourself
51. Give her lots of time, especially time for herself
52. Give her lots of space, never worrying about where she goes
IT IS VERY IMPORTANT:
53. Never to forget:
* birthdays
* anniversaries
* arrangements she makes
HOW TO MAKE A MAN HAPPY!!! :
1. Leave him in peace
2. Feed him well.
3. Let him have the remote control.
Men …. what a demanding creature !!!!!!!