Select range based on specific cell value to insert to ppt slides

  • Hello,


    I am trying to insert multiple excel ranges to multiple ppt slides with the data below:
    [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 86"]Title[/TD]
    [TD="width: 70"]Status[/TD]
    [TD="width: 98"]Issues[/TD]
    [TD="width: 64"]slide 1[/TD]

    [/tr]


    [tr]


    [td]

    a1

    [/td]


    [td]

    ok

    [/td]


    [td]

    xxxxx

    [/td]


    [/tr]


    [tr]


    [td]

    a2

    [/td]


    [td]

    ok

    [/td]


    [td]

    xxxxx

    [/td]


    [/tr]


    [tr]


    [td]

    Title

    [/td]


    [td]

    Status

    [/td]


    [td]

    Issues

    [/td]


    [td]

    slide 2

    [/td]


    [/tr]


    [tr]


    [td]

    a3

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    a4

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    a5

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    a6

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    Title

    [/td]


    [td]

    Status

    [/td]


    [td]

    Issues

    [/td]


    [td]

    slide 3

    [/td]


    [/tr]


    [tr]


    [td]

    a7

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    a8

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [tr]


    [td]

    a9

    [/td]


    [td]

    ok

    [/td]


    [td]

    ddddd

    [/td]


    [/tr]


    [/TABLE]

    i want to insert to each slide the range from the title-row until the begging of the next one (i.e A1:C3, A4:C8, A9:C12).


    If the number of rows were constant between the titles i.e 2 rows, then i could manage it with the below code (part of the code):


    [VBA]MySlideArray = Array(52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62)
    MyRangeArray = Array(Sheets("output2").Range("A1:C3"), Sheets("output2").Range("A4:C7"),....)
    For x2 = LBound(MySlideArray) To UBound(MySlideArray)
    MyRangeArray(x2).Copy
    Set shp = DPPt.Slides(MySlideArray(x2)).Shapes.PasteSpecial(DataType:=10, DisplayAsIcon:=msoFalse, link:=msoFalse)
    Next x2
    [/VBA]


    With the above data, i can't set fixed ranges inside the Array.


    Any help???


    Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!