我有一個工作簿,裏面有三張excel表格。 我希望用戶能夠從第二張表格中計算結果的第三張表格複製數據。 如何過,代碼我使用特定於表格的宏
'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
它也撤銷在第二板所做的更改。 看起來像Sheets(「AOS」)。Application.Undo不能正常工作。
任何建議..?