设置两个工作表的change事件过程代码。
sheet1中:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "A1" Then
With Application
.EnableEvents = False
ThisWorkbook.Sheets("Sheet2").Range("A1").Value = Target.Value
.EnableEvents = True
End With
End If
End Sub
sheet2中:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(0, 0) = "A1" Then
With Application
.EnableEvents = False
ThisWorkbook.Sheets("Sheet1").Range("A1").Value = Target.Value
.EnableEvents = True
End With
End If
End Sub