Share via

How to make Power point tables keep constant columns width when inserting columns?

Anonymous
2019-04-05T09:32:41+00:00

Inserting a column in power point tables keeps constant the total table width and each column width is adjusted. I would like to keep columns width constant and increase total table width. This is actually working as I want for inserting a Row, the total height changes and the rows height is kept constant.

How can I make the Insert Column works as the Insert Row?

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2019-04-05T15:54:58+00:00

You can’t do that natively but you could with a macro.

Sub ExtendTableWithColumn()

Dim shp As Shape

Dim ColumnWidth() As Single

Dim LastColumnWidth As Single

Dim I As Integer

'Assumes a shape is selected

Set shp = ActiveWindow.Selection.ShapeRange(1)

If Not shp.HasTable Then

    MsgBox "Select a table and then run this macro.", vbExclamation, "Extend table with column macro"

    Exit Sub

End If

ReDim ColumnWidth(shp.Table.Columns.Count)

'Read the existing column widths since they may not all be equal

For I = 1 To shp.Table.Columns.Count

    ColumnWidth(I) = shp.Table.Columns(I).Width

Next

'Get the last column width since we will append the new column with that width

LastColumnWidth = shp.Table.Columns(shp.Table.Columns.Count).Width

'Add the column

'This will fit the column into the existing shape width

shp.Table.Columns.Add

'Resize shape to new width

shp.Width = shp.Width + LastColumnWidth

'Reapply the old column widths

For I = 1 To UBound(ColumnWidth)

    shp.Table.Columns(I).Width = ColumnWidth(I)

Next

End Sub

Was this answer helpful?

3 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2019-04-05T10:34:05+00:00

    Pretty sure you cannot do this unless you are able write your own code to add the column and then resize all columns.

    Was this answer helpful?

    0 comments No comments