Private Sub Worksheet_Change(ByVal Target As Range)
Dim r, c
r = Target.Row
c = Target.Column
Application.EnableEvents = False 'a:可能不需要 , 或者不该有本句
If Target.Value = "" Then
Cells(r, c).Activate ' 当出现空值时 , 当前单元格任然 Activate
Else
If c = 2 Then Cells(r, 3).Activate
If c = 3 Then Cells(r, 4).Activate
If c = 4 Then Cells(r + 1, 2).Activate
End If
Application.EnableEvents = True 'b: 如果没有a, 本句也不需要
End Sub
|