troubleshooting Question

Change color of autoshape in vba

Avatar of bhlabelle
bhlabelleFlag for Afghanistan asked on
Microsoft Excel
1 Comment1 Solution386 ViewsLast Modified:
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.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros