vba -excel
对于我所描述的事件,是否有更好的解决方案?enter image description here
Dim bitExit As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If bitExit Then
Application.Undo
bitExit = False
Exit Sub
End If
Dim Cancel As Boolean
Cancel = BeforeCellChange(Target)
If Cancel Then
bitExit = True
Target = ""
End If
End Sub
Private Function BeforeCellChange(ByVal Target As Range) As Boolean
BeforeCellChange = True
End Function
1条答案
按热度按时间2wnc66cl1#
不如这样:
方法:
**Offset**用于恢复活动单元的位置
**EnableEvents**用于重置目标单元格的值