A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Here's a sample VBA code that you can use for the cell change event in Excel:
===================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("E:E")
If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
If Target.Value = "Y" Then
Range("B" & Target.Row & ":D" & Target.Row).Interior.Color = RGB(0, 255, 0)
Else
Range("B" & Target.Row & ":D" & Target.Row).Interior.ColorIndex = xlNone
End If
End If
End Sub
===================================
This code will check if any cell in column E has been changed. If the value of the changed cell is "Y", it will change the background color of cells in columns B to D to green. If the value is not "Y", it will remove the background color.
To use this code, you need to open the VBA editor in Excel, double click the sheet where you want to apply the code. Then, paste the code into the editor and save the workbook as a macro-enabled file.