Pulling color choice for whole workbook from one cell in one sheet

Skramp

New Member
Joined
Mar 26, 2019
Messages
4
Basically, what I want to do is have one cell on the first of 8 sheets be the decider for all 8 sheets. Like you pick the cell color in M8 on the first page and that color is carried over to the appropriate spots on all 8 pages. But, I want this to be automated, like once it's selected its applied.

I have this VBA that I can use for each page to make it happen, but forces you to select the color on in M8 on each sheet instead of just the first one.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("A8").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("D8").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("G8").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("A17").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("D17").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("G17").Interior.Color = Me.Range("M8").Interior.Color
Me.Range("A26").Interior.Color = Me.Range("M8").Interior.Color
End Sub

I have that set for each page, but it seems somehow I just need one for the whole workbook that references cell M8 on sheet 1.

Any thoughts or ideas?

Thanks
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,270
Office Version
365
Platform
Windows
How about
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim Ws As Worksheet
    For Each Ws In Worksheets
        Ws.Range("A8,D8,G8,A17,D17,G17,A26").Interior.Color = Me.Range("M8").Interior.Color
    Next Ws
End Sub
 

Skramp

New Member
Joined
Mar 26, 2019
Messages
4
That doesn't seem to pull the color from only the one cell. The cell I want to reference is M8 on sheet1. But i want sheet7 to pull that same color and fill in those cells also based on what is chosen on Sheet 1. Does that make sense?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,270
Office Version
365
Platform
Windows
If you put the code into sheet1 & remove all similar code from the other sheets, then whenever you select a cell on sheet1 the other sheets will get the cells coloured.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,270
Office Version
365
Platform
Windows
Glad to help & thanks for the feedback
 

Forum statistics

Threads
1,082,114
Messages
5,363,244
Members
400,722
Latest member
DrewPop24

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top