Reducing the Size of Spaces in a Selection

Written by Allen Wyatt (last updated December 27, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


1

George would like to condense only the space between words in some text he selects in a document. He can change the point size of each space, one at a time. He can also do it by finding the space and replacing it with a space that is a smaller font size. However, he would like to decrease the size of the spaces step by step. (For example, 0.1 points in each step.)

It isn't possible to do exactly what George wants because Word only allows you to adjust font size in half-point increments, not tenth-point increments. If decrementing by a half-point at a time will do, then the best approach is to use a macro:

Sub StepSpaceFontSize()
    Dim F As Double
    Dim C As Long

    For C = 1 To Len(Selection)
        If Asc(Mid(Selection, C, 1)) = 32 Then
            F = Selection.Range.Characters(C).Font.Size
            If F > 5 Then
                Selection.Range.Characters(C).Font.Size = (F - 0.5)
            End If
        End If
    Next C
End Sub

The macro steps through each character in whatever text is selected and, if the character is a space, decreases the point size of just that space. The macro enforces a bottom limit on font size, as it will only go down to 5 points.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13717) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Spelling Errors Resulting from Erroneous Spaces

Spelling errors can result from improperly ordering letters in a word, or from adding spaces where they shouldn't be. ...

Discover More

Printing Just the Visible Data

In a large worksheet, you may want to display and print just a portion of the available data. Displaying the desired ...

Discover More

Index Number for the Active Table

For some programming needs, it is important to determine the index of an object within a collection of such objects. This ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Determining the Upper Bounds of an Array

When working with variables in a macro, you may need to know the upper boundary dimension for an array. This can be ...

Discover More

Dissecting a String

Want to pull a string apart in a macro? It's easy using the string functions introduced in this tip.

Discover More

Setting the Left Indent of a Paragraph in a Macro

When using a macro to format text, you can set all sorts of attributes for paragraphs or individual characters. One ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

2019-12-28 06:47:20

Ken Endacott

The macro must be executed for each 0.5 point reduction in space size. The following macro repeats the reductions until cancelled.

Sub StepSpaceSize()
Dim aRange As Range
Dim k As Long
Dim F As Single
Set aRange = Selection.Range
Do While MsgBox("Reduce all spaces in selection by 0.5 points", vbOKCancel) = vbOK
k = 1
Do
If aRange.Characters(k) = " " Then
F = aRange.Characters(k).Font.Size
aRange.Characters(k).Font.Size = F - 0.5
End If
k = k + 1
Loop Until k > Len(aRange.Text)
aRange.Select
Loop
End Sub


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.