Mouse Clix

 

All about Macros…..what’s a Macro?

 

By: Hobie Lunin

 

Good question.  When I was new to computers, I saw the word Macro somewhere while I was working in Excel.  I did not have a clue what it was.  Little did I know what a great application Macros is and how it changed my way of doing things at work. 

 

A Macro is a shortcut.  With a tap of a keyboard key or the click of a button on a tool bar, you can perform a great variety of operations.  However, you can use them for simple operations like having your name and address appear at the top of your letter, or adding your closing at the end of one by just hitting a key combo.  This is a great time saving device.  What the computer can do is “record” a series of keystrokes that you make and then play them back as if they were taped.  For the purposes of this article, we will work in Word but Macros can be used in other applications such as Excel.  Let us say you want to start with an easy macro.  One that will type your name, address, phone and e-mail address so that if you are typing a letter you can add this information at the bottom of your letter by clicking a button on the formatting tool bar.  We will try to put the button up there next to the one you would use to Highlight; it looks like a brush with a yellow line underneath it.

 

First thing will be to open Word to a new blank screen.  Click on Tools and then Macro.  Select Record a new Macro on the cascading menu.  You will see a small window indicating that this is Macro 1, the only change you need to make here is to select in the “Store macro in” field, the selection calling for All Documents (normal.doc).  This will mean you can use this macro in any Word Document rather than only one.  Then click OK and you will be back to your blank page and there will be a small tool bar with 2 selections, the square at the bottom left is where you will turn the macro recording off.

 

At this point, the Macro is ready to record and you only need to type exactly what you want to appear each time you use the macro.  In this instance type your name, address and phone as well as e-mail address using whatever format appeals to you.  If you make a mistake, just correct it, when you have it the way you want, click on stop recording, the square button on that little bar.  You have just made your first macro.  To see how it works, remain with that page and hit Enter a few times to get a little further down on the page and then click on Tools and then Macro and this time select Macros.  Click on Macro 1 and then Run.  The macro will instantly duplicate what you have already typed.  Neat, huh?

 

OK, next we will assign a button on the tool bar for it.  Click on Tools and then customize.  Click the Commands tab.  In the category list, click Macros.  A list of macros appears.  Since you have only one, it will appear at the top of the list.  Drag it (it may be longer than you want, but we will shorten it next) up on to the tool bar.  A dark I beam pointer will show you where it is going to put the button.  Release it there and return to the Customize dialog box where you will drag (highlight) over the entry in the name box and type a new name for the button.  Pick something short so it does not take a lot of room.  Point to change Button Image and click on an image to select it.  The smiley face is easily seen if you are using blue color on your task bars as I have.  Click the Close button.  Now, click on your new tool bar button and see “what God hath wrought.”

 

If you wish to use a keystroke to enter your macro, you may do so by going back to the Paragraph above that starts “OK.”  At that point Click on Tools and then click the keyboard button.  Under Categories, click Macros.  Click on the Macro to which you want to assign the keyboard key combination.  Click the Press New Shortcut Key text box and then the key combination you want to use for this macro.  (Do yourself a favor and write it down immediately.)  If that key combo is already in use, you will get a message to that fact and then you will have to backspace to put in a different one.  If it is OK, click the assign button, then close.

 

For those of you who manipulate data in an Excel spreadsheet regularly, you can make use of Macros to move data from various cells and accumulate them on another spreadsheet such that you have a selection of data from your database.  You can add operations in your macro by typing in the code after clicking on edit.  This code/language is called Visual Basic and as I have personally proved, easy to learn.  So easy, that I was able to write a Production Control program after using a computer for only a few months.  I will have to admit spending lots of time and Barnes and Noble browsing through books there to find the code for certain operations.

 

Before you tackle that, however, try a few more Macros in Word and if you do use Excel and think macros will help you, please feel free to write me for additional information. Alternately, click on Help, Index and type in “Macro.”

 

Now you know what a Macro is.

 

Hobie Lunin is a Computer Instructor and Consultant.  He can be reached at mouseclix2@yahoo.com

 

Previous articles can be seen at http://mouseclix.tripod.com