Microsoft Office Tips for Word and Excel

How to Create and Use a Microsoft Word Macro

What is a Macro?

A Macro is a method of automating a series of actions. Macros can be used in both Microsoft Word and Microsoft Excel, but this tutorial will concentrate on Microsoft Word. Macros are like a very small program, however, they are even smaller than the most basic program or application.

Aren’t Macros “Viruses”?

A Macro is not a virus. It’s a program, in a sense (actually it’s smaller than a program). Macros for Microsoft Word and Excel are written in the Visual Basic scripting language (VB). Theoretically, if some unscrupulous person were to e-mail you a macro and you installed it – you could install a virus. However, Javascript, Java, Flash, Shockwave (older Flash), Frame .Net, and several other scripting languages that make the Internet work could also “hide” viruses. Just as you should avoid suspicious websites, always run anti-virus software, and run anti-spyware, and anti-adware programs on your computer – you shouldn’t install a suspicious “free” macro. But if you write the macros yourself in VB, or use the Macro Recorder in Word or Excel to create your own Macros – there shouldn’t be any problem and you shouldn’t encounter a virus. After all, Why would you put a virus in code you wrote yourself?

When to Use a Macro

It is important to give some thought as to what situations may be improved or made faster or more consistent by using Macros. Macros automate steps – to be worth it, it should be a fairly long, repetitive, series of steps. If you find yourself doing the same thing over and over, with no variation, a Macro might help you. The other key to using macros is that it must be the exact same series of steps – you cannot (easily) include a variable in a macro. So if you’re writing a phone list in Word but everyone’s name and phone number are different – that is not a good candidate for a Macro. Also, there should be several steps – if it’s just one or two, a Macro probably isn’t worth setting up.

There are other ways to automate formatting of text such as with Styles. And Find and Replace is a marvelous tool that can help and automate changing certain types of text formatting (such as removing double spaces after a period and replacing them with a single space.) You can also use a Macro to automate steps in a Find and Replace sequence.

When developing Macros, stick with repetitive tasks with several identical steps – but once set-up they can save you time.

How to Create a Macro

Creating a Macro is really very easy, although they are written in Visual Basic (VB), you don’t even need to know VB to create Macros. One of the easiest ways to create a Macro is by using Microsoft’s Macro Recorder.

  • In Microsoft Word 2010 and later, click the developer tab. If you don’t see the developer tab, do the following:
  •  Go to the File tab, then
  • Click Options, then
  • Click “Customize Ribbon”
  • Put a check mark in “Developer” and click “OK”
  • The Developer Tab should now be visible

Developer_tab

  • Next, click the Macro Recorder button – be sure you know what steps to perform for your macro because once you hit the record button every action will go into your Macro.

Record_Macro_Button_Dev-tab

For this lesson we will create a Macro to replace hard-coded line breaks with paragraphs marks. Why? Have you ever copied a professional article, or even a fanfic from on-line to Word for off-line reading – only to have it be only three and a half or four inches wide no matter what you do? The article or story has hard-coded line breaks at the end of every single line. To make the text flow, the first step is to get rid of the hard breaks. After the line breaks are removed, extra paragraph marks can be removed separately (and manually).

By hand (without a Macro) you remove a hard break by using Find and Replace.

  • Click Find (the binoculars)
  • Choose Replace… from the pull-down menu
  • Click More>>
  • Click Special and open it with the pull down menu

Find_and_Replace_Special-button

  • Click in “Find What” then click “Manual line break” in the Special Menu

Pop-up_Menu_Special-Characters_Find-Replace

  • Click in “Replace with” then click “paragraph mark”
  • Finally, click “Replace All”.
  • Once it’s run, it will tell you how many replacements it’s made. You can close out of Find and Replace.

To create a Macro using Recorder, press the Record button, do all the steps above, close out of Find and Replace, then click “End Record”. (If you want to know how many replacements were many each time you use the Macro stop recording with clicking “Replace All”. However, you’ll need to close “find and Replace” every time you run the Macro.)

The Macro dialogue will also ask you to name your Macro and if you want to assign it to a button or keyboard combination. I usually go with “button” and have the Macro on my Quick Access toolbar. When I’ve worked in Technical Writing and had ten or so Macros for different functions, our version of Word had a new Ribbon Group with all the Macros we used for work on it. But for a home user or small business, placing buttons on the Quick Access Toolbar is fine. And of course, if you would rather use a Keyboard Combo, that is fine too.

 

Advertisements

How to Create and Use Styles in Microsoft Word 2010

What are styles? Styles are a way to apply formatting to paragraphs in Microsoft Word with a single click. More importantly, by formatting your documents using styles – the documents will be consistent throughout. Consistency always looks more professional.

I’ve used styles in Word, since the XP version, but this tutorial will focus on how to create and use styles in Microsoft Office 2010 (the same techniques should work for Microsoft Office 360 or Cloud).

The first step in creating a new style is to click on the new style icon. If you don’t see a styles list or styles icon, follow the instructions in How to Customize the Quick Access Toolbar to add the Styles Icon to your Quick Access toolbar. If you have trouble with this step feel free to ask politely worded questions in the Comments.

To create a new style click the Styles Icon:

Styles_icon

At the bottom of the Styles list click the new style icon (highlighted below):

New Style

Clicking the new style icon will bring up the New Style Dialogue Box. On this first screen name your style. Use a descriptive but short name that describes what the style is for. Here I’ve named the style “Article Text”.

Styles_Dialogue1

You can also highlight a style that’s already in the Style List, and click the Modify Style icon (the two capital letter As with the pencil). If you modify an existing style, that style name will appear in the “Style based on” space, as seen above.

Next, modify the style to what you need. First, modify the paragraph options by clicking “Format”, then “Paragraph”. This will bring up the Paragraph Style Dialogue Box.

Styles3_Paragraph

Here you can set paragraph alignment, the line spacing, space after the paragraph, and even the first line indent. By setting space after at 6 pt (point) Word will automatically insert a blank line at the end of every paragraph that uses the style. It is no longer necessary to press return twice at the end of the paragraph to insert a blank line. This also avoids awkward extra spaces, such at page or column breaks. The Special box (set at “first line”, .5 above) means that each paragraph will have a five space indent at the beginning.

These options can be changed as needed. For example, in an academic paper it’s customary to set off a long quote by not only leaving lines before and after it but indenting the quote on both the right and left, with justified text, like this:

Quote_sample

Which is accomplished with the following Paragraph Settings:

Paragraph Quote

Plus setting the alignment as “Justify” and updating the font to “Bold”.

Which brings me to the next section for a Style: Font. Microsoft Word includes a large number of fonts, as well as Italic, Bold, and Underline options. You are probably used to using the bold option to emphasize a word in a document, or using the Italic option for titles of other works such as books or films. But you can also specify the font and its options using the Font Dialogue Box while creating a style.

Styles2_Font

While this might not seem remarkable for body text, where you probably aren’t going to want to use any special options other than picking your body font and size, however, it’s extremely useful when designing styles for headings, subheadings, and special formats such as captions, footnotes, long quotes, etc.

Here you can also see the advantage of using styles – you can simply type your paper, and set the normal paragraphs with the “Article Text” style (or whatever you’ve named the style) and to update a quote you simply highlight it and click the “Long Quote” style in the Style list. Headings and subheadings styles can be created and applied just as easily. If you have several heading and subheading styles, they will be consistent if you use Styles for formatting. It’s also possible to choose your style first, then type what you need, and it will be formatted according to the style.

Try creating and using styles in Word. They save time because it’s no longer necessary to format every paragraph separately. Styles will make your formatting consistent. For example, in the Long Quote Style above the indents are set at .7. If you didn’t use a style, and you formatted the long quotes as you went, in a 30 or 40-page paper, you might have some quotes indented at .5, some at .7 and some at 1.0. But if you use the Long Quote Style for each quote – they will all be exactly the same. And if you need to change or update the formatting, all you need do is modify the style – and the change will occur throughout your document (as long as “Automatically Update” is checked.)

How to Move and Customize the Quick Access Toolbar in Microsoft Word 2010

If you were dismayed to discover that in Microsoft Office 2010 all the menus you’d memorized were gone, you are not alone. And if you also miss having the ability to add custom buttons to your toolbar, I understand and feel your pain. But, all is not lost. This post will show you how to build a Quick Access Toolbar in Microsoft Word 2010. The same techniques work in Microsoft Excel, and can even be used to put buried options easily within reach in Microsoft Access. But let’s start with Microsoft Word.

The first thing you need to do is open Word and go to the File Ribbon (Click the File tab). You do not need to have a document open to do this. Go to Options and choose Quick Access Toolbar.

File_Tab_Options

The first thing you’ll want to do, is override the default placement of the Quick Access Toolbar above the Ribbon. Leaving the toolbar there makes it difficult to see (it almost hides) and difficult to get to (the Ribbon is in the way). Unless you intend to hide the ribbon entirely, simply click “Show the Quick Access Toolbar below the Ribbon”. A checkmark will appear next to the statement. Click “OK” to save (to apply the change).

 

Move Quick access Toolbar Below Ribbon

Next, after again going to File → Options → Quick Access Toolbar to re-open the dialogue box, in the Choose Commands From section, use the pull-down menu to select, All Commands. This will give you a very long alphabetical list of all Word commands. The list is long, but it’s the easiest way to find the commands you want to place on your toolbar.

Choose All Commands

Next, decide what commands you want on your toolbar. I suggest commands that not only you use frequently but that are buried in obscure places – making them difficult to access. I’ll talk more about commands you might want to add later. The illustration below shows how to add the Insert Hyperlink Command. Simply click the command in the command list on the left, click ADD, then click OK. Several commands can be added, to build your custom Quick Access Toolbar. The up and down arrows actually control where the commands are on the toolbar from left to right. So, in the illustration below, Open is to the left, followed by Save, followed by Save As, and so on to the right. When done, click OK to save all your changes.

Adding Insert Hyperlink

 

And there you have it – a custom toolbar, containing your most used commands, and/or commands that can be difficult to find or get to in Word 2010. Here is an example of how the Quick Access Toolbar looks (highlighted in yellow – additional commands can be reached by click the arrows circles in red).

Toolbar

 

Items that it can be handy to include:

  • Save As – The new Word really buries this one. If, like me, you often re-name files right in Word, so you can keep a previous version intact – this is a must-have. I always had a custom button for it in older versions of Word.
  • Insert Symbol – Why going poking around the insert page, trying to find this? Especially when you need it in the middle of document to correctly spell a name that uses accent marks of some sort? The Omega Sign is used for the Insert Symbol button – and besides letters with accent marks, it allows using the degree symbol (as in degrees Fahrenheit), copyright, registered trademark, and trademark symbols, arrows – to delineate steps or directions, etc.
  • Table shortcuts – I often work with tables, and I actually got used to using the shortcut buttons in Excel. When I began to need to update and edit tables in Word I found having the shortcuts accessible helped tremendously. I realize it may be hard to see, but the ones on the toolbar allow the insertion and deletion of rows and columns.

However, the point is to add to the Quick Access Toolbar commands you use constantly. Secondly, to add useful commands that are difficult to locate on the ribbons or that are buried in second and third level dialogues.