![]() |
|
#4
|
||||
|
||||
|
Most of your code can be removed to speed it up.
You start by applying a Table Style. A lot of the later code can be removed if the Table style being applied has those attributes as part of the style. Since that is a one off step to define the table style, you don't even need that to be part of the macro. The many lines adjusting the width of the columns can be reduced by deleting all but the last line for each column. For example the only line you need here is the one in red Code:
Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=148.85, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=154.45, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=163.05, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=170.1, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=177.2, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=184.3, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=191.4, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=198.45, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=205.55, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=212.65, RulerStyle:= wdAdjustNone Selection.Tables(1).Columns(5).SetWidth ColumnWidth:=212.65, RulerStyle:= wdAdjustNone
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to shorten English words of specific length by macro?
|
Emby | Word VBA | 4 | 10-16-2022 11:25 PM |
| Shorten multi-year timeline | Tyler V | Visio | 0 | 06-14-2022 08:35 AM |
| From recorded tro rational | Ulodesk | Word VBA | 4 | 02-07-2022 06:16 AM |
| How to shorten Outlook server connection timeouts? | mmo | Outlook | 0 | 12-12-2015 03:33 PM |
Shorten/delete auto-converted dotted horizontal line?
|
pstein | Word | 3 | 09-12-2012 01:05 AM |