将表格从powerpoint文件导出到excel文件
我有一个powerpoint文件,里面有很多表格。这些表具有相同的列。如何将这些表自动导出到一个excel文件 到目前为止你试过什么?StackOverflow在这里帮助您解决您已经研究和编写的代码的问题,而不是从头开始为您做这项工作。我可以手动将表复制到excel。是否有一种方法可以自动执行此操作,例如使用VBA?我肯定有,但正如我所提到的,这不是一种代码编写服务。将表格从powerpoint文件导出到excel文件,excel,powerpoint,Excel,Powerpoint,我有一个powerpoint文件,里面有很多表格。这些表具有相同的列。如何将这些表自动导出到一个excel文件 到目前为止你试过什么?StackOverflow在这里帮助您解决您已经研究和编写的代码的问题,而不是从头开始为您做这项工作。我可以手动将表复制到excel。是否有一种方法可以自动执行此操作,例如使用VBA?我肯定有,但正如我所提到的,这不是一种代码编写服务。 Sub DataTransfer() Dim shp As Shape, i%, j% ' Dim colCount
Sub DataTransfer()
Dim shp As Shape, i%, j%
' Dim colCount As Integer
' Dim rowCount As Integer
Dim rowNum As Integer
Dim rng As Object
Set rng = GetObject(, "Excel.Application").Range("a1") ' start at top of worksheet
For i = 1 To ActivePresentation.Slides.Count
For Each shp In ActivePresentation.Slides(i).Shapes
If shp.HasTable Then
With shp.Table
colCount = .Columns.Count
rowCount = .Rows.Count
For rowNum = 0 To .Rows.Count - 1
For j = 0 To 4
rng.Offset(rowNum, j).Value = (.Cell(rowNum + 1, j + 1).Shape.TextFrame.TextRange)
Next j
rng.Offset(rowNum, 4).Interior.Color = (.Cell(rowNum + 1, 5).Shape.TextFrame.TextRange)
Next rowNum
Set rng = rng.Offset(rowNum + 1)
End With
End If
Next shp
Next i