用于将Excel数据复制到现有powerpoint表的VBA代码

时间:2015-02-09 20:56:35

标签: vba powerpoint excel-2013

我有条件复制指定范围的单元格的代码,打开以前保存的PowerPoint模板,并打开正确的幻灯片。我需要编写相当于(右键单击,粘贴特殊K)的代码。我想我很接近,但最后一点需要帮助。

Sub CreateStaffTemplate()
With Worksheets("Feb")
    Select Case .Range("C20").Value
        Case .Range("B4").Value:    .Range("B6:D15").Copy
        Case .Range("F4").Value:    .Range("F6:H15").Copy
        Case .Range("J4").Value:    .Range("J6:L15").Copy
        Case .Range("N4").Value:    .Range("N6:P15").Copy
    End Select
End With

Dim PPT As PowerPoint.Application
Dim myShapeRange As PowerPoint.Shape
Dim myPresentation As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim SlideNum As Integer
Dim ppTable As PowerPoint.Table

Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="C:\Users\xxxxx\Desktop\Staff Meeting Template.pptm"
PPT.Activate
PPT.ActivePresentation.Slides(2).Select
Set ppTable = PPT.ActivePresentation.Slides(2).Shapes(2).Table
ppTable.??????????????

我搜索了几个小时,但没找到我需要的东西或翻译过的东西。

0 个答案:

没有答案