基于单元格值将Excel选项卡导出到Powerpoint幻灯片中



希望您能提供帮助。

VBA新手,我一直在寻找问题的答案,但找不到我要找的东西。

我有一个工作簿,里面有很多选项卡,可以保存不同的数据和叙述。只有当这些选项卡的单元格"CI8"大于0时,我才需要一些方法将这些工作表(打印视图区域(导出到单独的PowerPoint幻灯片中。例如,我有一个名为"RestWest"RestCentre"RestEast"RestRS"的选项卡,如果只有RestWest和RestRS的单元格CI8>0,那么只有这两张表会进入Powerpoint。最好是粘贴成图片。

我已经能够将其导出为PDF,但高级管理人员更喜欢PowerPoint。

希望你能帮我,给我一些建议。

感谢您抽出时间

应该包括以下代码,因为它将一张纸拉入PowerPoint,但需要包括单元格值标准

Sub CopyRangeToPresentation()
Dim pp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide
Dim SlideTitle As String
Set pp = New PowerPoint.Application
Set PPPres = pp.Presentations.Add
pp.Visible = True
Set PPSlide = PPPres.Slides.Add(1, ppLayoutTitleOnly)
PPSlide.Select
Sheets("RestWest").Range("A1:CV77").CopyPicture _
Appearance:=xlScreen, Format:=xlPicture
PPSlide.Shapes.Paste.Select
pp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
pp.ActiveWindow.Selection.ShapeRange.Align msoAlignMiddles, True
SlideTitle = "My First PowerPoint Slide"
PPSlide.Shapes.Title.TextFrame.TextRange.Text = SlideTitle
pp.Activate
Set PPSlide = Nothing
Set PPPres = Nothing
Set pp = Nothing
End Sub

TheSpreadsheetGuru-复制&用VBA 将Excel区域粘贴到PowerPoint中

我也是一个新手,但看看这个链接,也许可以尝试一下:

For Each sht In Worksheets
With sht
If .Range("CI8").Value2 > 0 Then
.Range("Print_Area").Copy
'use SpreadSheetGuru to show you how to insert new slide and paste
' ...
End If
End With
Next

最新更新