![]() |
|
#1
|
|||
|
|||
![]()
Word table auto text alignment vs. cell height
I would like to use a VBA to clean up a word document table by aligning text in the each by a set of criteria eg height of cell = 6pt use macro one and if greater than 6 points use marco 2 I have been able to write the script separately but can think on away to join the two Marcos together so I physical don’t have to select the macro on each line or groups of line At the moment I just selected Marco 1 or Macro2 depending on looking at each line this is very time consuming for 140 tables in a work doc So the outcome I want is. Run the Marco and it starts where the cursor is and continues through all the tables in the document highlighted with cursor the information on each line in the table is formatted and aligned determine to the height of the cell Cell single height e.g. 6 point Selection.SelectCell Selection.Font.Name = "Arial" Selection.Font.ColorIndex = wdBlack Selection.Font.Size = 11 Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Options.DefaultHighlightColorIndex = wdYellow Selection.Range.HighlightColorIndex = wdYellow Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.SelectCell And if the cell is greater than 6 point < double height Selection.SelectCell Selection.Font.Name = "Arial" Selection.Font.ColorIndex = wdBlack Selection.Font.Size=11 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.Cells.VerticalAlignment = wdCellAlignVerticalTop Options.DefaultHighlightColorIndex = wdYellow Selection.Range.HighlightColorIndex = wdYellow Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.SelectCell Can someone add the missing code for me so it auto formats the table and then I can just run on each word table or all table it will save hours Thanks Grant |
|
![]() |
||||
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 |
![]() |
markand_bhatt2008 | Excel | 1 | 04-29-2013 07:46 AM |
![]() |
gib65 | Word | 1 | 06-02-2012 03:03 PM |
![]() |
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 |