I need to copy rows in PowerPoint 2003 (just to re-use their formatting). Tried to do:
Dim oPPTRow As PowerPoint.Row
Set oPPTRow = oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(2)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows.Add (-1)
oPPTFile.Slides(SlideNum).Shapes(1).Table.Rows(oPPTTable.Rows.Count) = oPPTRow
But it doesn’t work. Is there any other way to achieve the same?
The Rows.Add method lets you insert a new row before any row you like. The newly inserted row will pick up the formatting of the row you inserted it ahead of. Try this (be sure to select a tabel shape first):
Passing -1 as the parameter to .Add forces PPT to add the row at the end of the table; the new cells will all be formatted the same as the cells above them (that is, the cells in the row that was previously the bottom row).
If you need to pick up formatting from some other row, I think you may need to do something like: