Excel Excel format changing when using copy and paste

Joined
Aug 1, 2011
Messages
1
Reaction score
0
hello,

I've used this code below (found on this forum) in a worksheet to successfully ignore the source formatting when copying/pasting into the spreadsheet, however as stated on the thread i found it on, it disables the undo/redo options (and possibly more??).

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myValue
With Application
.EnableEvents = False
myValue = Target.Formula
.Undo
Target.Formula = myValue
.EnableEvents = True
End With
Application.CutCopyMode = False
End Sub

Any ideas on how to modify it to allow the use of undo/redo? And i've actually just realised that macros reset the undo/redo function when they run and because this is a macro that runs all the time it will always reset undo/redo. Any ideas on a modification to run on open/close or something? or even better, to do this without a macro?

Cheers
 
Last edited:

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