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
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,365
Office Version
  1. 365
Platform
  1. 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
55,365
Office Version
  1. 365
Platform
  1. 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
55,365
Office Version
  1. 365
Platform
  1. Windows
Glad to help & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,127,240
Messages
5,623,565
Members
415,981
Latest member
Baltwin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top