Changes on a worksheet
The following sub is called when the user changes a value on a
worksheet. If the changed value is in the second column, the code changes the color of the cell left to it to a specific color.
The code for the sub must be placed into the Visual Basic component belonging to the worksheet rather than into a specific code module.
private sub worksheet_change(byVal cell as range)
'
' Check if user changed value in 2nd column:
if cell.column = 2 then
'
' Change cell's color one to the left
'
cell.offset(0, -1).interior.color = rgb(200, 130, 30)
end if
end sub