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
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
 
Upvote 0
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?
 
Upvote 0
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.
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,213,534
Messages
6,114,185
Members
448,554
Latest member
Gleisner2

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
Back
Top