Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-22-2016, 05:28 AM
macropod's Avatar
macropod macropod is offline Word table auto text alignment vs cell height Windows 7 64bit Word table auto text alignment vs cell height Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,536
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It's not at all apparent how you expect to have 11pt text in tables with a 6pt row height, but they're your tables:
Code:
Sub FormatTables()
Application.ScreenUpdating = False
Dim oTbl As Table, oCel As Cell
For Each oTbl In ActiveDocument.Tables
  With oTbl.Range
    With .Font
      .Name = "Arial"
      .ColorIndex = wdBlack
      .Size = 11
    End With
    .HighlightColorIndex = wdYellow
    .ParagraphFormat.Alignment = wdAlignParagraphLeft
    .Cells.VerticalAlignment = wdCellAlignVerticalTop
    For Each oCel In .Cells
      If oCel.Height > 6 Then
        oCel.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
      End If
    Next oCel
  End With
Next oTbl
Application.ScreenUpdating = True
End Sub
The above code processes all tables in the document. To process a particular set of tables, change ActiveDocument to Selection, then select the tables to process before running the macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting text from Excel cell into word without creating a table, and keeping the in-cell formatting hanvyj Excel Programming 0 08-28-2015 01:15 AM
Word table auto text alignment vs cell height Row auto height markand_bhatt2008 Excel 1 04-29-2013 07:46 AM
Word table auto text alignment vs cell height table cell alignment issue gib65 Word 1 06-02-2012 03:03 PM
Word table auto text alignment vs cell height Table Text Alignment? Jazz43 Word Tables 2 08-19-2010 08:07 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:41 PM.


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