Color of a cell changes automatically when the color of another cell changes

Jherjher001

New Member
Joined
Jan 6, 2018
Messages
3
Good day experts,

I would like to ask for some help on color of a cell changes automatically when the color of a cell from another sheet changes:

Example:


Sheet1!D3 to change color automatically whenever the color in Sheet2!B2 changes.

Sheet1!B5 to change color automatically whenever the color in Sheet2!B3 changes.

Sheet1!B7 to change color automatically whenever the color in Sheet2!B4 changes.

Sheet1!C4 to change color automatically whenever thecolor in Sheet2!B5 changes.

jv6Ymc
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Good day experts,

I would like to ask for some help on color of a cell changes automatically when the color of a cell from another sheet changes:

Example:


Sheet1!D3 to change color automatically whenever the color in Sheet2!B2 changes.

Sheet1!B5 to change color automatically whenever the color in Sheet2!B3 changes.

Sheet1!B7 to change color automatically whenever the color in Sheet2!B4 changes.

Sheet1!C4 to change color automatically whenever thecolor in Sheet2!B5 changes.

jv6Ymc

Hi and welcome to the forum.

Excel doesn't provide an event when a cell color changes but I can think of a workaround.

You didn't say to which color the cells will change .. Will the cells in Sheet1 aquire the same color of their respective cells in sheet2 ?
 
Last edited:
Upvote 0
Add the following code to the ThisWorkbook Module :

Code:
Option Explicit

Private WithEvents cmbrs As CommandBars

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Set cmbrs = Application.CommandBars
    Call cmbrs_OnUpdate
End Sub

Private Sub cmbrs_OnUpdate()
    Application.CommandBars.FindControl(ID:=2040).Enabled = Not Application.CommandBars.FindControl(ID:=2040).Enabled
    With Sheet2
        Sheet1.Range("D3").Interior.Color = .Range("b2").Interior.Color
        Sheet1.Range("B5").Interior.Color = .Range("b3").Interior.Color
        Sheet1.Range("B7").Interior.Color = .Range("b4").Interior.Color
        Sheet1.Range("C4").Interior.Color = .Range("b5").Interior.Color
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,937
Members
449,094
Latest member
teemeren

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