提前感谢您的帮助!
我使用Worksheet_Change(ByVal Target As Range)
事件不 Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
事件。经过一些测试后,我意识到我的事件已触发,但参数Target
始终设置为Nothing
。一些代码和图片休耕。
Private pNet As Range
Private pProposedValue As Range
'EVENT HANDLERS
'--------------
Private Sub Worksheet_Change(ByVal Target As Range)
If pProposedValue Is Nothing Then
ElseIf pNet Is Nothing Then
ElseIf Target Is pNet Then
pProposedValue.Value2 = Target.Value2
Me.Calculate
End If
End Sub
答案 0 :(得分:2)
Is
不能检查一个范围变量是否与另一个范围变量引用相同的范围。
Target Is pNet
即使引用相同的范围也会为假。