SheetChange event restore old value

  • Thread starter Thread starter Anton Sommer
  • Start date Start date
A

Anton Sommer

Hello folks,

when the SheetChange event is thrown a cell got change in the grid, and that
cell I can tell by the property of the target variable. Good, but is there a
chance to restore the old value before the editing took place? (like pushing
the red cross buton when entering somtehing manually).


Thanks

Anton
 
You can use application.undo something like this

Private Sub Worksheet_Change(ByVal Target As Range)
If LCase(Target.Value) = "this" Then Application.Undo
End Sub

If you type in the word this it undoes what was typed back to the previous
value of the cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top