How do I change the color Excel Autoshape using VBA?

G

Guest

I'm trying to change the color of an Autoshape I've drawn on a spreadsheet
base on the value of a given cell. Can anybody help me?
 
G

Guest

hi Jmtricker

how about something like this:

activesheet.shapes("yourshape").color = RGB(Cell1,Cell2,Cell3)

the name and the correct syntax for the shape i would lookup
with recording a macro and then putting it together.
Although when you record a macro, excel always uses select,
you can write it without the select.

If there is any problem you can also post the code the recorded
Macro and we can have a look at it.

hth

Carlo
 
N

Nick Hebb

Slight correction - the syntax is:

ActiveSheet.Shapes("yourshape").Fill.ForeColor.RGB = RGB(Cell1, Cell2,
Cell3)
 

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