Written by Allen Wyatt (last updated December 27, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
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:
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.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Word keeps track of identifying and statistical information about a document and makes that information available in the ...
Discover MoreFormulas created in a macro have a specific order in which operations are performed. This is known as precedence, as ...
Discover MoreWouldn't it be great if Word could execute a macro every time someone typed in a particular keyword or phrase? Word may ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments