Seeking macros to auto populate a table in powerpoint

May 13, 2013

Hello,

Is anyone familiar with any sites that have code or examples available where VBA code will automatically populate an existing table in Powerpoint/Articulate Engage? Thank you!

Cindy

3 Replies
Jerson  Campos

Where is the source information coming from? Will this require an action like pressing a button or will it be automatically updated?  I've never done macros in powerpoint, but I've done them in excel. I usually start of asking specific questions to what I'm attempting to do in Google. If I don't get the results I'm looking for, then I start asking more general questions.  Usually I find answers where I can cut and hack some macro together to get what I want.

Cindy Sharon

Thank you for the reply Jerson. I will have four scenario based slides. After each scenario will be an answer slide. The answer slide will appear when a user clicks a 'reveal' button. I was hoping that once the user clicks the reveal button a table (can either already exist) or will be created on the fly and the user will watch it populate. For the first example, I hope to have a four column and table row built. The column headings are static (From Amount, To Amount, Percentage Paid by Plan, and Percentage Paid By Consumer.) The values for the two rows are( $0.00, $500.00. 80%, 20) and ($1,500.00, Plan Maximum, 50%, 50%). I know in the past one could record macros in PPT. Now sure if this is still an option in PPT 2010. Thank you!

Paul Kornman

Here's some VBA to fill in a table: (This assumes the Table is the first shape on slide 2 with 5 rows and 3 columns):

It puts the word "Cell" and the row and column numbers in the corresponding cell:

Sub FillTable()
    Dim nRow As Integer
    Dim nCol As Integer
    With ActivePresentation.Slides(2).Shapes(1).Table
        For nRow = 1 To 5
            For nCol = 1 To 3
                .Cell(nRow, nCol).Shape.TextFrame.TextRange.Text = "Cell " & nRow & " " & nCol
            Next nCol
        Next nRow
    End With
End Sub

.HasTable will tell you if a given shape is a table

.Table.Columns.Count gives you the number of columns

.Table.Rows.Count give you the number of rows

Do you need something more?

Paul K.

This discussion is closed. You can start a new discussion or contact Articulate Support.