Highlight shapes in PowerPoint
Problem
You want to be able to click a shape during a presentation and change its color to highlight it while it's being discussed, then click again to set it back to its original color.
Solution
This little macro will do the job for you. Add it to your presentation then assign it as the action setting for each shape you might want to click:(rightclick the shape, choose Action Settings, Run Macro, HighlightMe). Then start the show. Each time you click a shape with this macro assigned, it'll change the shape's fill color to the Highlight color you set in the macro. Click the shape again to return it to its original color.
Sub HighlightMe(oSh as Shape) Dim lHighlightColor as Long ' Edit this to change the highlight color lHighlightColor = RGB(255,255,0) ' bright yellow ' Look at the clicked shape's fill color With oSh.Fill.ForeColor ' Depending on the .RGB value of the fill color ... Select Case .RGB ' If it's already highlighted, we've "tagged" ' it with the original color; use that Case lHighlightColor .RGB = CLng(oSh.Tags("OriginalColor") ' Otherwise, it must not be highlighted so ' "tag" the shape with the RGB value of the current fill ' color, then change the fill to the highlight color Case Else Call oSh.Tags.Add("OriginalColor", CStr(.RGB)) .RGB = lHighlightColor End Select End With End Sub
See How do I use VBA code in PowerPoint? to learn how to use this example code.