Macro for changing the colors of objects based on user input

S

sara

Here's my problem:
I take hours creating an architecture blue print/flow chart and my boss
doesn't approve some of the colors in the legend. At times there are atleast
20-30 objects with that color and it takes me AGES to change the color( to be
told that i need to change the color yet again). Its a very suboptimal way of
changing the presentation and i am figuring out how to do it using VBA:
Here is what i want to achieve( in edit or presentation mode):

1. Take input from user about which color to change (R,G,B value). I'll
store it as OldColor
2. Take input from user about which color to change to (R,G,B value). I'll
store it as NewColor
3. Find all objects on current slide whose color is OldColor and change to
NewColor

here is my broken code as of now:
"
Dim NewColor As Long
Dim OldColor As Long
Dim x, y, z As Integer

take input from user for color to change in the form of RGB into variables
x,y,z
OldColor = RGB(x, y, z)
' Take input from user for color to change to: in the form of RGB into
variables x,y,z
NewColor = RGB(x, y, z

' Select current slide.
Dim currentslide As Long
currentslide = ActiveWindow.Selection.SlideRange.SlideIndex
for all shapes in currentslide with Fill.ForeColor.RGB == OldColor
change Fill.ForeColor.RGB = NewColor


Any thoughts? suggestions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top