just tell us what your problem is, so somebody can helpcan you provide an example of what you're trying to do ?
then provide the link pleaseI've seen it because I downloaded the addin.
this can only be done when the value which has been replaced is stored somewherea command for Undoing or Redoing of any value you just entered...
Option Explicit
Public OldValue As Variant
Public OldRange As Range
Sub replace_value()
OldValue = ActiveCell
Set OldRange = ActiveCell
ActiveCell.Value = Application.InputBox("Please enter something to add to " & ActiveCell.Address(0, 0), Title:="TITLE", Default:=ActiveCell)
End Sub
Sub undo()
OldRange.Value = OldValue
End Sub
I would like to know if anybody knew the code for this.
http://www.j-walk.com/ss/dataform/index.htmerik.van.geit said:then provide the link pleaseI've seen it because I downloaded the addin.
let's be clear (again)
no operation using code (macro) can be "undone" unless the operation is logged some way
you tell us
this can only be done when the value which has been replaced is stored somewherea command for Undoing or Redoing of any value you just entered...
for multiple undo you can copy the sheet and hide it
when user selects "cancel all operations" the hidden sheet would replace the actual sheet ...
you tell us John WalkenBach has done this: FINE! but why do you expect others to search the internet if you already found something: just provide the link please!
little example (no userform, just normal module)
Code:Option Explicit Public OldValue As Variant Public OldRange As Range Sub replace_value() OldValue = ActiveCell Set OldRange = ActiveCell ActiveCell.Value = Application.InputBox("Please enter something to add to " & ActiveCell.Address(0, 0), Title:="TITLE", Default:=ActiveCell) End Sub Sub undo() OldRange.Value = OldValue End Sub
you've downloaded an add-in: isn't the code visible ?Code:I would like to know if anybody knew the code for this.
kind regards,
Erik
This is just what I've been telling you all the time.CAN I LET THE USER UNDO MY MACRO?
Yes, but it's not something that can be done automatically. To enable the user to undo the effects of your macro, your VBA code module must keep track of what was changed by the macro
don't know how many euro a dollar is, but if you want his code, just pay himHe's making you pay $20.00 for the CODE.