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