7

I have a lot of (> 200) tables in Word that have the same layout (two columns, six rows).

I need to adjust the column widths for all of them. Is there a way to automate this?

1 Answer 1

8

You could use a VBA macro to resize every table.

Press ALT+F11 in Word and insert the macro under Project » ThisDocument.
Execute the code with F5

Sub resizeTables()    
  For Each Table In ActiveDocument.Tables
    On Error Resume Next
    Table.Columns(1).Width = 200
    Table.Columns(2).Width = 300
    On Error GoTo 0
  Next    
End Sub
  • Columns(2) represents the column 2 in every table
  • The value Width = 300 is your desired width in pixel. Change it to your needs
  • If your table has less columns than your VBA macro, you will get an exception. For this, I added On Error Resume Next to ignore errors and On Error GoTo 0 to stop this error handling

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .