Excel VB Shapes: Change for and text based upon certain variables
Posted on 2007-11-26
I have a bunch of different shapes on a page. These shpaes will change a certain color based up a specifc circumstance in a specifc cell. I need my code to work like this: If cell f8 greater than or equal to f9 then change the shape interior color to green if f8 is less than or equal to 10% of f9 than change it yelow and if f8 is more than 10% less than f9 than change it to red or if cell f9 is blank than change the interior color to white with black font. Every oval must also have the value of cell f8 put inside of it as text. I have some code below, but i couldn't figure out how to make this work. Thanks for the help.
ActiveSheet.Shapes("One").Fill.ForeColor.RGB = RGB(255, 0, 0)
Shapes("One").TextFrame.TextRange.Text = a1