I have a workbook with three excel sheets in it. I want a user to be able to copy data from the third sheet which is result of calculations in the second sheet. How ever, the code I am using
'The code for the Macro
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim col As String
Dim msg As String
col = Split(Target.Address(1, 0), "AOS")(0)
'Permet d'éviter les modifications des modifications manuelles des cellules calculées automatiquement
If Intersect(Target, Sheets("AOS").Range("A3:AP100")) Is Nothing Then Exit Sub
'We're going to make a change, so turn this off
'so that macro doesn't get called infinitely
Sheets("AOS").Application.EnableEvents = False
Sheets("AOS").Application.Undo
MsgBox "Can't touch this!", vbCritical + vbOKOnly, "Error !!!!!"
Sheets("AOS").Application.EnableEvents = True
It is also undo changes made in second sheet. Seems like, Sheets("AOS").Application.Undo is not working as it should be.
Any Suggestions..?