ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   importing powerpoint table to excel (https://www.excelbanter.com/excel-programming/433279-importing-powerpoint-table-excel.html)

Lynn[_7_]

importing powerpoint table to excel
 
how do i go about importing a table in powerpoint to excel?

joel

importing powerpoint table to excel
 
I saw thgis posting on Saturday morning but had the macro stored on a
different computer. Here is the code. The code goes through each sheet in
the power point file and gets each table. The tables are within shapes
objects on each power point sheet.

Sub GetSlides()

FName = "c:\temp\test.ppt"
Set obj = GetObject(FName)
obj.Application.Visible = True

Set ExcelSht = ThisWorkbook.Sheets(1)
NewRow = 1

For Each slide In obj.Slides
With slide.Shapes
For i = 1 To .Count
If .Item(i).HasTable Then
Set MyTable = .Item(i).Table
For Each MyRow In MyTable.Rows
Col = 1
For Each MyCol In MyRow.Cells
With ExcelSht
Set DataCell = MyCol.Shape.TextFrame.TextRange
.Cells(NewRow, Col) = DataCell.Text
Col = Col + 1
End With
Next MyCol
NewRow = NewRow + 1
Next MyRow
End If
Next
End With
Next slide

obj.Close
Set obj = Nothing
End Sub



"Lynn" wrote:

how do i go about importing a table in powerpoint to excel?



All times are GMT +1. The time now is 06:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com