How to Autofit Text in a Cell Using Word

Anonymous
2021-02-07T23:14:20+00:00

I have created a table using Microsoft Word for Mac. All of the table cells are formatted to be a non-expandable, fixed size. This is exactly how I wanted the table set up.

I have selected to have Wrap Text within each cell. When text is entered into the cell it will automatically move down to a new line within the cell when the text reaches the end of the current line. (see sample cell photo). This is exactly how I wanted the text to adjust between lines within the cell.

Since the cell is formatted to be a non-expandable, fixed size - if one were to keep inputting text within the cell, the writing moves down into an unseeable abyss. This is definitely not ideal.

If I select to have the cell Fit Text, the letter size reduces to allow all text to fit. However, it will not wrap to the next line to fill the cell. It simply stays on a single line.

How do I combine these features so the text will FIRST automatically move down a line AND THEN shrink the text to fit within the cell once the end of the second line has been reached?

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Paul Edstein 82,806 Reputation points Volunteer Moderator
    2021-02-08T03:11:27+00:00

    You could do that by inserting a line-break at the appropriate point in the text. The line-break insertion could be semi-automated with a macro. For example:

    Sub Demo()

    Dim i As Long, sWdth As Single

    With Selection

      If .Information(wdWithInTable) = False Then Exit Sub

      With .Cells(1)

        sWdth = .Width - .LeftPadding - .RightPadding

        With .Range

          .Font.Scaling = 100

          If .Characters.First.Information(wdVerticalPositionRelativeToPage) <> _

            .Characters.Last.Previous.Information(wdVerticalPositionRelativeToPage) Then

            .FitTextWidth = sWdth * 2

          End If

          For i = 1 To .Characters.Count

            If .Characters(i).Information(wdHorizontalPositionRelativeToTextBoundary) > sWdth Then

              .Characters(i).InsertBefore Chr(11): Exit For

            End If

          Next

        End With

        .FitText = True

      End With

    End With

    End Sub

    With the above macro, anything more than one line's worth of content will be rescaled to fill two lines.

    2 people found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-02-10T10:07:01+00:00

    Hi CLBP03,

    Thanks for using Microsoft products and posting in the community, may I know if you have checked the above solution provided by @macropod? When you have time, you are welcome to come back and let us know if you still need help here.

    Hope you are all well during this period, stay safe and have a nice day : )

    Best Regards,

    Arck

    0 comments No comments
  2. Anonymous
    2021-02-11T08:34:41+00:00

    I'm afraid macros are well above my pay grade. While what you're saying sounds as though it would absolutely address my issue, I have no idea how to enter a macro-or even knew that was a possibility!

    0 comments No comments
  3. Paul Edstein 82,806 Reputation points Volunteer Moderator
    2021-02-11T11:12:26+00:00

    For PC macro installation & usage instructions, see: Installing Macros (gmayor.com)

    For Mac macro installation & usage instructions, see: Word:mac - Install a Macro (wordmvp.com)

    0 comments No comments
  4. Anonymous
    2021-02-19T04:47:36+00:00

    Paul,

    I read the directions you attached (Very helpful!) and inserted the macro you added. Then a Microsoft Visual Basic Compile error: Expected End Sub pop-up appeared. There is only one End Sub at the end of the macro and I couldn't find anything else to indicate where I went wrong. Any other attempts I made to correct this simply brought up more pop-ups.

    Do you have any suggestions?

    CLBP

    0 comments No comments