I was looking for VBA code so that any time I copy and paste text from anywhere into Excel, it will match the destination formatting. I found 2 different codes to do it:
Sub PasteWithDestinationFormatting()
ActiveCell.PasteSpecial (xlPasteAll)
End Sub
and
Sub PasteWithDestinationFormatting()
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, DisplayAsIcon:=False
End Sub
Both of them work but the problem is that they both disable the use of the "Undo" button, and the "Ctrl + Z" shortcut. I'm trying to figure out why that is and what I can do to fix it.
Thank you!