1
我的代码如下。基本上每个PowerPoint演示表只能容纳32行值得Excel数据(与标题行),所以我想滑数,增加每32行和Excel通过数据跨行到复制周期。如果这样做没有意义,我会很乐意尝试和进一步解释,但是想要给我的问题提供某种形式的背景。循环,不这样做,即使我有一个做
至于我可以看到我有一个做,直到,循环,如果和结束,如果。但我得到了'没有做'的错误,并且我为什么不知所措。
N = 2
Do Until n = lrow
Set oPPTShape = oPPTFile.Slides(SlideNum).Shapes("Table 3")
With oPPTShape.Table
If n Mod 33 <> 0 Then
.Cell(n, 1).Shape.TextFrame.TextRange.Text = Cells(n + 3, 1).Text
.Cell(n, 2).Shape.TextFrame.TextRange.Text = Cells(n + 3, 2).Text
.Cell(n, 3).Shape.TextFrame.TextRange.Text = Cells(n + 3, 3).Text
.Cell(n, 4).Shape.TextFrame.TextRange.Text = Cells(n + 3, 4).Text
.Cell(n, 5).Shape.TextFrame.TextRange.Text = Cells(n + 3, 5).Text
n = n + 1
Else
SlideNum = SlideNum + 1
.Cell(n, 1).Shape.TextFrame.TextRange.Text = Cells(n + 3, 1).Text
.Cell(n, 2).Shape.TextFrame.TextRange.Text = Cells(n + 3, 2).Text
.Cell(n, 3).Shape.TextFrame.TextRange.Text = Cells(n + 3, 3).Text
.Cell(n, 4).Shape.TextFrame.TextRange.Text = Cells(n + 3, 4).Text
.Cell(n, 5).Shape.TextFrame.TextRange.Text = Cells(n + 3, 5).Text
n = n + 1
End If
Loop
非常感谢!
对不起,修改后,用excel vba自动创建一个power point的演示文稿。 – Dave
您错过了'End With'。 – SJR
不能相信我错过了会尝试!谢谢,如果不是专注于结束,而是忙于结束! – Dave