Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-22-2016, 02:04 AM
Grantsub Grantsub is offline Word table auto text alignment vs cell height Windows 10 Word table auto text alignment vs cell height Office 2013
Novice
Word table auto text alignment vs cell height
 
Join Date: Aug 2016
Posts: 6
Grantsub is on a distinguished road
Default Word table auto text alignment vs cell height

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
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 10:41 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