Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize-to-fit Table Columns

Status
Not open for further replies.

icu222much

Technical User
Mar 12, 2007
26
CA
I have a table in PowerPoint with several rows and columns of data. I would like to resize selected columns so the width of the column does not exceed the width of the longest data - in otherwords make the column width the perfect fit. I am wondering how I would go abouts in doing this?

Below are my various attempts but they have failed as when I went to run my macro, the column widths did not change.

Code:
mySlide.Shapes(mySlide.Shapes.Count).Table.Cell(x, y).Shape.TextFrame.WordWrap = msoFalse
mySlide.Shapes(mySlide.Shapes.Count).Table.Cell(x, y).Shape.TextFrame.AutoSize = ppAutoSizeShapeToFitText
Code:
mySlide.Shapes(mySlide.Shapes.Count).Table.Columns(1).Width = ppAutoSizeShapeToFitText
Code:
mySlide.Shapes(mySlide.Shapes.Count).Table.Cell(targetRow, targetColumn).Shape.TextFrame.AutoSize = ppAutoSizeShapeToFitText
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top