![]() |
#1
|
|||
|
|||
![]() I need to align left the text in column 2 from line 2 to the last line in a word table, how can I do that? Thanks all.
__________________
Backup your original file before doing any modification. |
#2
|
||||
|
||||
![]()
This will probably fail if you have merged cells in your table but it will get you started
Code:
Sub Macro1() Dim iRow As Integer, iRows As Integer With Selection.Tables(1) iRows = .Rows.Count For iRow = 2 To iRows .Cell(iRow, 2).Range.ParagraphFormat.Alignment = wdAlignParagraphLeft Next iRow End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
![]()
Thanks Guessed, works fine!
I also did this using select. Code:
Dim oTbl As Table Set oTbl = ActiveDocument.Tables(1) With oTbl .Range.Columns(2).Select Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft .Cell(1, 2).Select Selection.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter End With Set oTbl = Nothing Code:
Set oRng = ActiveDocument.Range(Start:=oTbl.Cell(2, 2).Range.Start, End:=oTbl.Cell(5, 2).Range.End)
__________________
Backup your original file before doing any modification. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
supersimu | Word | 1 | 01-25-2014 02:05 AM |
![]() |
tinfanide | Word | 3 | 11-24-2013 06:37 AM |
![]() |
tamaracklodge | Word Tables | 4 | 03-04-2013 04:00 AM |
![]() |
ghumdinger | Word | 2 | 08-18-2011 10:15 AM |
How do I align image at ABSOLUTE top left of a table cell? | shnoozin | Outlook | 0 | 07-22-2011 03:30 PM |