Macros:How to select a specific column of a table and format it using macro?
With cursor in applicable table/applicable row, the following would
resize and set a font size value:
Sub FormatTableCol()
Dim oTbl As Table
Dim oCell As Cell
Dim i As Integer
Set oTbl = Selection.Tables(1)
i = Selection.Information(wdStartOfRangeColumnNumber)
oTbl.Columns(i).SetWidth ColumnWidth:=InchesToPoints(0.5),
RulerStyle:=wdAdjustNone
For Each oCell In oTbl.Columns(i).Cells
oCell.Range.Font.Size = 20
Next
End Sub
|