
If the value is greater than 100, the adjacent cell in column B is changed to the color red. The following code example verifies that, when a cell value changes, the changed cell is in column A, and if the changed value of the cell is greater than 100.

Private Sub Worksheet_Change(ByVal Target as Range) The following code example changes the color of changed cells to blue. Use the Calculate event to trap a sheet recalculation. This event does not occur when cells change during a recalculation. SyntaxĮxpression A variable that represents a Worksheet object. Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.Occurs when cells on the worksheet are changed by the user or by an external link. If Intersect(Target, Range("A1:A10")) Is Nothing Or > 1 Then Exit Sub Private Sub Worksheet_Change(ByVal Target As Range) The following code example sets the values in the range A1:A10 to be uppercase as the data is entered into the cell. Range("B" & ThisRow).Interior.ColorIndex = xlColorIndexNone Range("B" & ThisRow).Interior.ColorIndex = 3 Private Sub Worksheet_Change(ByVal Target As Excel.Range)


Occurs when cells on the worksheet are changed by the user or by an external link.
