Avatar of bhlabelle
bhlabelle
Flag for Afghanistan asked on

Change color of autoshape in vba

I have a spreadsheet with a few autoshapes, and I want the user to be able to change the color in one cell, press a button to run my code, and have all the autoshapes change to the color in the cell.  I wanted to try this for one autoshape to begin with, but I'm running into a weird problem.

I have the following code

Dim Color as Integer
Color = Sheets("My Sheet").Cells(1,"A").Interior.ColorIndex
ActiveSheet.Shapes("AutoShape 2").Fill.ForeColor.SchemeColor = Color

So if I change the color in Cell 1, A to red, I get the corret ColorIndex set as my integer, however, it does not change the autoshape color to red.  It seems to blend the red with the previous color.  While this might not be what is actually happening, I can tell you that the color is changed, but it is not to red.
Microsoft Excel

Avatar of undefined
Last Comment
bhlabelle

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
bhlabelle

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck