Fix Excel VBA Reset Button Colors and Worksheet Change Events
Question details
The user needs Excel reset buttons to reflect changes to their associated cells without responding to unrelated edits or reset operations.

- Product
- Microsoft Excel VBA
- Device & OS
- not provided
- Scenario
- A worksheet uses change events to update reset button colors and macros to restore baseline cell values.
- Observed behavior
- Button colors can change incorrectly when unrelated cells are edited, values are compared with formulas, or reset macros trigger worksheet events.
Identify the cells, baseline cells, and button names associated with each reset action. In Excel, open Developer > Visual Basic and locate the worksheet module and reset macros; adjust the example names and ranges to match your workbook.
Limit Worksheet_Change to relevant cells and compare values
Use this approach when edits to unrelated cells change button colors or multiple buttons update at once.
The example uses B2:B4 on the User Entry worksheet, matching baseline values on the Formulas worksheet, and shapes named Reset1, Reset2, and Reset3. Each button is green when its cell matches the baseline and red otherwise.
The example assumes the compared cells contain values that can be compared directly, not Excel error values. Worksheet_Change responds to direct changes, not formula recalculation alone.
In Developer > Visual Basic, find the User Entry worksheet in Project Explorer and double-click it. Place the event procedure in that worksheet module, not in a standard module.
Add or adapt this procedure: Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Long Dim entryCell As Range Dim baseline As Worksheet If Application.Intersect(Target, Me.Range("B2:B4")) Is Nothing Then Exit Sub Set baseline = ThisWorkbook.Worksheets("Formulas") For i = 1 To 3 Set entryCell = Me.Range("B2").Offset(i - 1, 0) If Not Application.Intersect(Target, entryCell) Is Nothing Then If entryCell.Value2 = baseline.Range(entryCell.Address).Value2 Then Me.Shapes("Reset" & i).Fill.ForeColor.RGB = RGB(0, 176, 80) Else Me.Shapes("Reset" & i).Fill.ForeColor.RGB = RGB(255, 0, 0) End If End If Next i End Sub
Edit a cell outside B2:B4, then change B2 and restore it to the value on the Formulas sheet. Confirm that unrelated edits leave the buttons alone and only Reset1 changes for B2.

Disable events while a reset macro restores cells
Use this with the worksheet event procedure to prevent reset operations from triggering intermediate color updates.
Work with Excel spreadsheets in WPS Office
WPS Office is a free, lightweight alternative for everyday spreadsheet work, with a familiar interface and Excel format compatibility to help you move existing files. Fixing Excel's VBA events still requires troubleshooting in Excel.

Frequently Asked Questions
Why do all my reset buttons change when I edit one cell?
The button logic may run outside the Intersect check. In the worksheet's Worksheet_Change procedure, check Target against each relevant range and put each button's comparison and color update inside its own branch.
Why doesn't Worksheet_Change run when a formula recalculates?
Worksheet_Change handles cell changes, not recalculation alone. If button colors depend on recalculated formula results, consider Worksheet_Calculate and test its behavior separately.
How do I turn Excel events back on after a macro stops?
In Developer > Visual Basic, open View > Immediate Window, type Application.EnableEvents = True, and press Enter. Add error-handling cleanup to reset macros so they restore the previous event state.
Should I compare a cell's value with a baseline formula?
Compare the evaluated values, such as entryCell.Value2 and baselineCell.Value2, when checking whether the results match. Compare Formula properties only if you need to check whether the formulas themselves match.




