0

I have a slide that we use in my department to provide an overview of the progress regarding project document deliverables. It is shown in a graphic manner, and therefore a simple table view or similar cannot be used. Each of the document deliverables mentioned on the slide can have 3 different legends (figures), a square, triangle and arrow. These are color coded according to stakeholder responsibility of the deliverable. Right now we are changing each one of them manually during the project

What I am looking for: Is there a VBA code that can easily be used to replace these figures according to project status? I imagine each Project deliverable needs to be tagged with a position on the slide, and then a userform can be used to select which type of figure there should be assigned?

Anyone who can help me or point me in a direction to something that might help me is highly appreciated!

Thank you Peter

Mayfarm
  • 3
  • 2
  • Welcome to the site. If you're doing the process manually, then something I've found handy is to use the macro recorder then borrow the code you need from it. [Microsoft's instructions](https://msdn.microsoft.com/en-us/library/office/ff838320.aspx). And in order to get a specific answer, [please check this out](http://stackoverflow.com/help/how-to-ask) – Jimmy Smith Feb 20 '17 at 19:24
  • 1
    @Jimmy Smith unfortunately powerpoint has no macro recorder since many years. MS gave up to make it work – Christine Ross Feb 20 '17 at 19:27
  • @ChristineRoss I did not know this. I've primarily used it years ago for Word and Excel. OP, not sure if the "figures" you refer to are images, but here's an [example to borrow from](http://stackoverflow.com/questions/28274753/replace-existing-image-in-ms-powerpoint-with-a-new-image-using-vba) or if they're just shapes, [this might help](http://stackoverflow.com/questions/22099887/change-shape-color-in-a-loop-vba-ppt) – Jimmy Smith Feb 20 '17 at 19:33
  • Here is a [link](https://msdn.microsoft.com/en-us/library/ff743835.aspx) to the powerpoint object model. Mostly "Shape" is the right object, but you can also look for chart. – Christine Ross Feb 21 '17 at 07:53

1 Answers1

0

Here's one approach in rough outline ...

Instead of individual shapes, use a square, triangle and arrow grouped. The user selects the group they want to work with then launches your dialog box where they choose the project status for that item. Your dialog box assigns a value from 1 to 3 to the status then calls SetVisibility like so:

Sub MakeItSo()
    Call SetVisibility(2)
End Sub

SetVisibility first makes all of the shapes in the group invisible, then sets the appropriate shape to be visible:

Sub SetVisibility(lStatus As Long)
    Dim x As Long
    With ActiveWindow.Selection.ShapeRange(1)
        For x = 1 To .GroupItems.Count
            .GroupItems(x).Visible = False
        Next
        .GroupItems(lStatus).Visible = True
    End With
End Sub
Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • Great idea ! I will try to pursue that instead, will also make it more simple to maintain! thanks a lot ! – Mayfarm Feb 23 '17 at 09:10