|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 YZC51 于 2019-8-27 18:41 编辑
优化下
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Row > 14 Then Exit Sub
If Target.Address = "$G$2" Then [b5].Select
If Target.Row < 5 Then Exit Sub
If Target.Address = "$J$14" Then
[c2].Select
Else
If Target.Column = 3 Then Target(1, 2).Select
If Target.Column = 6 Then Target(1, 3).Select
If Target.Column = 10 Then Target(2, -7).Activate
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.CountLarge > 1 Then Exit Sub
If Target.Row > 14 Then Exit Sub
If Target.Address = "$G$2" Then [b5].Select
If Target.Row < 5 Then Exit Sub
If Target.Address = "$J$14" Then
[c2].Select
Else
If Target.Column = 6 Then Target(1, 3).Select
If Target.Column = 10 Then Target(2, -7).Activate
End If
End Sub |
|