View Single Post
 
Old 04-01-2015, 05:23 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following will probably do the trick.

Code:
Sub ShrinkCellTextToFit()
Dim orng As Range
Dim i As Long
Const iCol As Integer = 2        'the column to process

    If Not Selection.Information(wdWithInTable) Then
        MsgBox "Put the cursor in the table and try again"
        GoTo lbl_Exit
    End If
    For i = 1 To Selection.Tables(1).Rows.Count
        Set orng = Selection.Tables(1).Cell(i, iCol).Range
        orng.End = orng.End - 1
        Do Until orng.ComputeStatistics(wdStatisticLines) = 1
            orng.Font.Shrink
        Loop
    Next i
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote