1

I have vba in an Excel 2010 workbook, that creates Powerpoint 2010 slides. These slides contain tables that are populated from identical tables in the Excel workbook.

I want to apply alignment, number formatting, and margins (at least for starters) to the cells in the PP slide tables.

I have found solutions to format the table cells by walking through the rows and formatting each cell in that row one at a time, but my tables are typically column oriented so that makes the row solution undesirable (and slow).

This is my current, row-oriented code:

Set shapetable = activeSlide.Shapes.AddTable(numRows, 8)
With shapetable
    With .Table
       For iRow = 1 To .Rows.Count
          For Each cl In .Rows(iRow).Cells
             With cl.Shape.TextFrame
                .TextRange.Font.Size = "8"
                .TextRange.ParagraphFormat.Alignment = msoTextEffectAlignmentCentered
             End With
          Next cl
       Next iRow
    End With
End With

Is it not possible to simply walk across the columns of the table and set these formats "per column"?

Community
  • 1
  • 1
jtyoder
  • 11
  • 1
  • instead of generating a table in PPT, could you instead embed an excel document in the PPT thus inheriting the excel column formats already applied? – xQbert Jun 07 '16 at 20:35
  • You can walk across the columns then down the cells in each column, but I figure you know this. I don't see any way to format all of the cells in a column (or row) at one whack, though. That should be .TextRange.Font.Size = 8 by the way (no quotes around the 8 ... it's a single, not a string) – Steve Rindsberg Jun 08 '16 at 14:56

0 Answers0