title: How to fit column width in macro?
body: <p>I wrote a macro which copies table from excel to word. In excel all columns have different width. In Word I want to fit my table to one page - margins in Word are 1.5 cm from left and right. Number of rows in my table changes, number of columns is stable (this is 14). How can I set column width to be equal? I wonder if it's possible to set the same column width regardless of the amount of text in headlines. I create swdth variable which I then divide by 14 (all my columns) and I have my table on one page...</p>
  
  <p>This code doesn't work properly. I have all rows in one page, but columns have different width.</p>
  
  <pre><code>Table.Rows.SetHeight RowHeight:=InchesToPoints(0.17), HeightRule:=wdRowHeightExactly
  Table.Rows(1).SetHeight RowHeight:=InchesToPoints(0.59), HeightRule:=wdRowHeightExactly
  sWdth = InchesToPoints(6.22)
  WordTable.PreferredWidthType = wdPreferredWidthPoints
  WordTable.PreferredWidth = sWdth
  sWdth = sWdth / 14
  </code></pre>