Changing column size on multiple tables

M

madlan

Hi,

I have 100's of small tables across several documents that need their
five columns adjusted - at the moment I am ctrl clicking the first
column in each table until I reach the end of the document then
adjusting the size. This is obviously taking ages! Is there another way
of doing this?
The columns on the mentioned tables all have the same value in the
first cell.

Regards,
Al.
 
M

macropod

Hi madlan,

If all the tables in a given document need to have the same configuration, you could use a macro like:

Sub SetTableColumnWidths()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
With oTbl
.AllowAutoFit = False
.Columns(1).PreferredWidth = InchesToPoints(1)
.Columns(2).PreferredWidth = InchesToPoints(1.25)
.Columns(3).PreferredWidth = InchesToPoints(2.25)
End With
Next
End Sub

If you're working in metric units, you could change 'InchesToPoints' to 'CentimetersToPoints'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top