One object reference another

M

Mike

I have one shaded box and and I want another shaded box to always be the same
color as the first. Is there a way to link the two so when i chence the color
on the main one, the second one will also change, without programming. Didn't
know if there was a way to put a formula in for a shape.
 
A

abmorgan

when you say box do you mean a rectangle? ie drawn from the drawing
toolbar? or do you mean a cell.
i'm pretty sure you need some code for this

right click on the sheet in which your rectangles sit and select view
code
select from the first dropdown box at the top of the page Worksheet
then from the next Selection change

ensure the code in the winddow below looks like this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.Shapes("Rectangle 2").Fill.ForeColor.SchemeColor = _
ActiveSheet.Shapes("Rectangle 1").Fill.ForeColor.SchemeColor
End Sub

this assumes your second rectangle is rectangle 2 and your first
rectangle 1

somethinglikeant
 
M

Mike

Thanks. I just was trying to avoid having to actually run a macro. Didn't
think about doing one that would run as soon as the change was made. Works
great.
 
Top