change cell color based on a tab color

G

Guest

How do I change the color of a cell on one worksheet based on the color of a
different tab worksheet? Example. I have cell A3 on Worksheet 1, and I want
it to change based on the tab color of worksheet 3.

Thanks,
 
S

stevebriz

Here is an example


Private Sub CommandButton1_Click()
Sheets(1).Select
Range("A1").Select
ActiveCell.Interior.ColorIndex = Worksheets(3).Tab.ColorIndex
End Sub
 
G

Guest

I wrote the following subroutine, and it does change the color, but only
after I run the macro. How can I make it so the color of cell B5 will
automatically change when the color of the tab changes?

Sub SetActive()
Worksheets("Sub-system").Activate
Worksheets("Sub-system").Range("B5").Activate
ActiveCell.Interior.ColorIndex = Worksheets("Memory").Tab.ColorIndex
End Sub

Thanks,
 
S

stevebriz

you could add itas part of your worksheet_change or
worksheet_calculate or do you have any other forms buttons you use a
lot on the form.
Do you have any cells that change regularly llike totals or click
regularly that you can refer to or you could add a button..like update
all?
 

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