Jack.Conroy
12-30-2015, 09:18 PM
Hi,
I am new to VBA and looking for some assistance on a code to change the colour of a specific shape on a powerpoint slide (but not all slides - just the active slide I am on). The current shape is a ShapeSnipRectangle (Left:=515, Top:=0, Width:=205, Height:=80) and is coloured RGB(255, 255, 102).
I have the below code but this changes all shapes in all slides not just the current slide.
Sub Slide_Updated()
Dim oSh As Shape
Dim oS1 As Slide
For Each oS1 In ActivePresentation.Slides
For Each oSh In oS1.Shapes
If oSh.Fill.ForeColor.RGB = RGB(255, 255, 102) Then
oSh.Fill.ForeColor.RGB = RGB(179, 222, 104)
End If
Next oSh
Next oS1
End Sub
Thanks,
Jack.
I am new to VBA and looking for some assistance on a code to change the colour of a specific shape on a powerpoint slide (but not all slides - just the active slide I am on). The current shape is a ShapeSnipRectangle (Left:=515, Top:=0, Width:=205, Height:=80) and is coloured RGB(255, 255, 102).
I have the below code but this changes all shapes in all slides not just the current slide.
Sub Slide_Updated()
Dim oSh As Shape
Dim oS1 As Slide
For Each oS1 In ActivePresentation.Slides
For Each oSh In oS1.Shapes
If oSh.Fill.ForeColor.RGB = RGB(255, 255, 102) Then
oSh.Fill.ForeColor.RGB = RGB(179, 222, 104)
End If
Next oSh
Next oS1
End Sub
Thanks,
Jack.