Re: How do i auto fill cell color based on other cells' color?
Nope, You don't need to add a module, you just add to the sheet's code page.
Excel Sheets allow the programmers to customize their objects methods
The VBA MACRO uses the Sheet's internal methods for event detection, the event it self is "selection change", this method is triggered each time you change from cell to cell, not the color change but the cell selection change (the actual cell).
If you don't know how to enter VBA editor, if you don't see developer tab, press the Office Button and Excel Options, in Popular, the third row of checkboxes "show developer tab", just check it.
Then in the developer tab, select visual Basic and click on the sheet you want to modify that method, and paste to it. Back on the sheet you will see the effect of this method changed. But beware, the code just change the text to nothing, no the color.
A modiffication to the code that may work out.
Dim OLD_SELECTION As Range, OLD_COLOR As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If OLD_SELECTION Is Nothing Then
Set OLD_SELECTION = Target
OLD_COLOR = OLD_SELECTION.Interior.Color
end if
If Range(OLD_SELECTION.Address).Column = 1 And OLD_COLOR <> OLD_SELECTION.Interior.Color Then
Cells(OLD_SELECTION.Row, 2).Interior.Color = OLD_SELECTION.Interior.Color
End If
Set OLD_SELECTION = Target
OLD_COLOR = OLD_SELECTION.Interior.Color
End Sub