Excel表格中VBA代码自动向右跳转三次后自动向上跳转?
发布网友
发布时间:2022-05-02 23:30
我来回答
共1个回答
热心网友
时间:2022-06-28 08:50
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If IsNumeric(Target.Value) Then
If Target.Address = "$C$3" Then
Range("D3").Activate
ElseIf Target.Address = "$D$3" Then
Range("E3").Activate
ElseIf Target.Address = "$E$3" Then
Range("C2").Activate
ElseIf Target.Address = "$C$2" Then
Range("D2").Activate
ElseIf Target.Address = "$D$2" Then
Range("E2").Activate
ElseIf Target.Address = "$E$2" Then
Range("C1").Activate
End If
End If
End Sub