Excel 怎样实现用键盘按键启动宏
答案:1 悬赏:80 手机版
解决时间 2021-04-05 06:02
- 提问者网友:相思似海深
- 2021-04-04 05:22
Excel 怎样实现用键盘按键启动宏
最佳答案
- 五星知识达人网友:不如潦草
- 2021-04-04 07:02
在表格的OPEN事件中加入
Private Sub Workbook_Open()
Application.OnKey "{UP}", "UP"
End Sub
复制代码
在模块中加入
Sub UP()
On Error Resume Next
Dim Rng As Range, x%
If Intersect(ActiveCell, Sheet1.Range("G3:G7")) Is Nothing Then Exit Sub
Set Rng = Sheet3.Range("J2:J7")
x = Right(ActiveCell.Address, 1) - 2
Rng(x) = Rng(x) + 1
End Sub
Private Sub Workbook_Open()
Application.OnKey "{UP}", "UP"
End Sub
复制代码
在模块中加入
Sub UP()
On Error Resume Next
Dim Rng As Range, x%
If Intersect(ActiveCell, Sheet1.Range("G3:G7")) Is Nothing Then Exit Sub
Set Rng = Sheet3.Range("J2:J7")
x = Right(ActiveCell.Address, 1) - 2
Rng(x) = Rng(x) + 1
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯