从Excel Sheet在每个ppt幻灯片上创建不同的图

我认为这是我第一次问到这样的论坛,但是让我试一下,因为我确实必须完成我的论文。

我用23个问题进行了调查。有三组人回答了调查,现在我在excel表中保存了数据: enter image description here

现在,我想为每个问题做一个深潜幻灯片(enter image description here),在此我可以比较不同小组的回答方式。我已经尽力用来自excel的数据填充幻灯片的内容,但是我一直坚持让图表选择它们的数据。因此,我将每个关系图所需的所有数据都放在一行中,我只需要为每个数据系列手动选择数据,这样就可以节省数小时来了解如何自动进行此操作。我遇到了SetsourceData方法,但无法使其正常工作。甚至没有提到我必须为图表提供不同的数据系列。

非常感谢您的帮助:)

还可以找到到目前为止我使用过的代码:

Sub CreateSlides()
'Open the Excel workbook. Change the filename here.
Dim OWB As New Excel.Workbook
Set OWB = Excel.Application.Workbooks.Open("C:\Users\jonas\Desktop\My Cloud Offline-Dateien\MC Documents\Uni\Bachelorarbeit\Workshop mit Case Study\Auswertung\191104_Auswertung Workshop Survey_v0.3.xlsb")
'Grab the first Worksheet in the Workbook
Dim WS As Excel.Worksheet
Set WS = OWB.Worksheets(1)
'Loop through each used row in Column A
For i = 1 To WS.Range("A65536").End(xlUp).Row
    'Copy the first slide and paste at the end of the presentation
    'activePresentation.Slides(1).Copy
    'activePresentation.Slides.Paste (activePresentation.Slides.Count + 1)

    'Change the text of the first text box on the slide.
    'M1
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(43).TextFrame.textrange.Text = WS.Cells(i,1).Value
    'Fragetext
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(4).TextFrame.textrange.Text = WS.Cells(i,2).Value

    'Testgruppe: n
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(8).TextFrame.textrange.Text = "n = " & WS.Cells(i,24).Value
    'Testgruppe: µ
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(9).TextFrame.textrange.Text = "µ = " & WS.Cells(i,3).Value
    'Testgruppe: sigma ChrW(963)
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(10).TextFrame.textrange.Text = ChrW(963) & " = " & WS.Cells(i,9).Value
    'Testgruppe: d vs Kontroll
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(12).TextFrame.textrange.Text = "d = " & WS.Cells(i,12).Value
    'Testgruppe Effekt vs Kontroll
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(13).TextFrame.textrange.Text = WS.Cells(i,13).Value
    'Testgruppe d vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(15).TextFrame.textrange.Text = "d = " & WS.Cells(i,14).Value
    'Testgruppe Effekt vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(16).TextFrame.textrange.Text = WS.Cells(i,15).Value

    'Kontrollgruppe: n
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(19).TextFrame.textrange.Text = "n = " & WS.Cells(i,25).Value
    'Kontrollgruppe: µ
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(20).TextFrame.textrange.Text = "µ = " & WS.Cells(i,4).Value
    'Testgruppe: sigma ChrW(963)
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(21).TextFrame.textrange.Text = ChrW(963) & " = " & WS.Cells(i,10).Value
    'Testgruppe: d vs Test
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(23).TextFrame.textrange.Text = "d = " & WS.Cells(i,18).Value
    'Testgruppe Effekt vs Kontroll
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(24).TextFrame.textrange.Text = WS.Cells(i,19).Value
    'Testgruppe d vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(26).TextFrame.textrange.Text = "d = " & WS.Cells(i,16).Value
    'Testgruppe Effekt vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(27).TextFrame.textrange.Text = WS.Cells(i,17).Value

    'Experten: n
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(30).TextFrame.textrange.Text = "n = " & WS.Cells(i,26).Value
    'Expertengruppe: µ
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(31).TextFrame.textrange.Text = "µ = " & WS.Cells(i,5).Value
    'Testgruppe: sigma ChrW(963)
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(32).TextFrame.textrange.Text = ChrW(963) & " = " & WS.Cells(i,11).Value
    'Testgruppe: d vs Test
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(34).TextFrame.textrange.Text = "d = " & WS.Cells(i,20).Value
    'Testgruppe Effekt vs Kontroll
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(35).TextFrame.textrange.Text = WS.Cells(i,21).Value
    'Testgruppe d vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(37).TextFrame.textrange.Text = "d = " & WS.Cells(i,22).Value
    'Testgruppe Effekt vs Experten
    activePresentation.Slides(activePresentation.Slides.Count).Shapes(38).TextFrame.textrange.Text = WS.Cells(i,23).Value
Next
End Sub
yc135 回答:从Excel Sheet在每个ppt幻灯片上创建不同的图

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3158077.html

大家都在问