excel中怎么让俩个下拉列表同步

2022-08-12 体育 138阅读
设置两个工作表的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
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com