I need a code either as vba or validation which will pop up a message after values in a…
- User
I need a code either as vba or validation which will pop up a message after values in a sheet are changed. The pop up will ask if I want to allow the change I made to the cell value and if I select yes it will keep the change. If I however select No the cell will revert to its former value. I do not want the code to continuously loop.
- Assistant
Here's a VBA code that will give you a message box when you change a value in a cell, and if you choose "No," it will undo the change:
Private Sub Worksheet_Change(ByVal Target As Range) Dim confirmation As Integer On Error Resume Next Application.EnableEvents = False confirmation = MsgBox("Do you want to save this change?", vbYesNo) If confirmation = vbNo Then Application.Undo End If Application.EnableEvents = True End SubJust paste this code into the sheet module where you want this functionality to apply. This code will not continuously loop and will only give you the message box when a value in a cell is changed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.