Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-01-2015, 05:23 AM
gmayor's Avatar
gmayor gmayor is offline tables: fit only long lines to avoid line break Windows 7 64bit tables: fit only long lines to avoid line break 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
tables: fit only long lines to avoid line break keep several lines & images together without a page-break interfering lyle Word 1 02-11-2014 03:57 AM
Asian typography in text boxes - how to avoid lines starting with periods markpete Word 0 11-17-2012 01:45 PM
tables: fit only long lines to avoid line break Is there a way of keeping words together so that they don't break over two lines? Mayla Word 2 06-04-2012 07:37 AM
Break Pivot Into Multiple Tables Pramalot Excel 0 05-22-2012 05:21 AM
tables: fit only long lines to avoid line break Avoid merging tables b0x4it Word 4 06-14-2011 10:01 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft