undoing a VB action

R

RICH

I have the attached code to sheet! Basically it gives me the user name and
date when a value is altered. What I want to do is for the user to be able
to undo the changes they make.

Any ideas?

Thanks in advance!

Rich :eek:)


Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column <> 15 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If IsEmpty(Target.Offset(0, 9)) Then
Target.Offset(0, 10) = Date
Target.Offset(0, 9) = Application.UserName
End If
End Sub
 
T

Tom Ogilvy

You would need to build your own record of what the sheet was like before
the user started making changes, then provide a means for them to select to
undo - then replace the changes with the original.

Most macros, when run, cause the undo history to be erased and undo does not
record changes made by a macro.
 
R

RICH

Yep agree with what you're saying. The only prob is to do that the file has
to be saved externally. It's a 2MB file so saving is an issue.

Looks like there isn't an alternative!

Thanks anyway!

Rich :eek:)
 

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

Top