Loading
Word.Tips.Net WordTips (Menu Interface)

Fitting Text Into Cells

Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Fitting Text Into Cells.

You have worked long and hard on your page design, including a couple of tables that are just right. Then, along comes a need to add a bit more text into one of the tables. The result is that the text in a cell wraps and pushes everything else down a bit. Now your whole design is thrown off! You long for a way to automatically adjust the size of the text in a cell so you won't have the wrapping and pushing occur.

If you are using Word 2000, Word 2002, or Word 2003 there is a built-in option that may do the trick. Simply follow these steps:

  1. Select the cell or cells that you want to format.
  2. Choose Table Properties from the Table menu. The Table Properties dialog box is displayed.
  3. If necessary, select the Cell tab. (See Figure 1.)
  4. Figure 1. The Cell tab of the Table Properties dialog box.

  5. Click on the Options button. Word displays the Cell Options dialog box. (See Figure 2.)
  6. Figure 2. The Cell Options dialog box.

  7. Make sure the Fit Text check box is selected.
  8. Click on OK to close the Cell Options dialog box.
  9. Click on OK to close the Table Properties dialog box.

What Word does is to decrease the apparent size of the text so that everything fits. Word decreases the width of the text by "scrunching" (a highly technical term) the text together horizontally, without adjusting it vertically.

If you are using Word 97, there is no inherent way to accomplish the task. Word doesn't provide any properties you can check to determine the width of various characters, each of which could be different sizes and have other attributes. You can, however, create a macro that may help you by displaying the width of a text string in points or inches. For instance, the following VBA macro displays an input box so you can input your string, displays the Font dialog box so you can specify font and point size, and then displays the width of the resulting string.

Sub GetStringLength()
    Dim sngInitPos As Single
    Dim sngEndPos As Single
    Dim strText As String
    Dim sngLength As Single

    strText = InputBox("Enter the string whose length you want to determine")
    Documents.Add
    Dialogs(wdDialogFormatFont).Show

    sngInitPos = Selection.Information(wdHorizontalPositionRelativeToPage)
    Selection.InsertAfter strText
    Selection.EndOf
    sngEndPos = Selection.Information(wdHorizontalPositionRelativeToPage)
    sngLength = sngEndPos – sngInitPos

    MsgBox "Your string has a length of " & sngLength & _
        " points, or " & PointsToInches(sngLength) & " inches."
    ActiveDocument.Close savechanges:=False
End Sub

The only difficulty with this macro, of course, is that it isn't "automatic." For instance, it won't adjust the size of a text string to the maximum size possible to fit within a cell. In the long run it may be easier to just experiment with different font sizes for information in the cell until you find the right size for your needs.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (3780) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Fitting Text Into Cells.

Related Tips:

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

Daniel    14 Sep 2016, 05:47
IF the text fits already without resizing is there a way to keep the formatting without it stretching to fit?

Basically can you format the cells so that text only resizes if it is too big and stay as it is if it fits already (similar to in Excel)
Jose QuiƱones    08 Aug 2015, 12:20
I like your page but when I follow instructions the text become unreadable shrinks too much and up to just one line.
somebody    21 Feb 2015, 10:12
finally found a useful site thanks loads
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.