excel中如何输入单个字母a,b,c,d,e,f,g后使自动跳到下一格
若以下回答无法解决问题,邀请你更新回答
2个回答
展开全部
说难不难,说易不易
时间关系,明天给代码
时间关系,明天给代码
更多追问追答
追问
Sub auto_open()
Application.OnKey "3", "j"
Application.OnKey "4", "k"
Application.OnKey "5", "m"
End Sub
Sub j()
ActiveCell.Value = 3
SendKeys "{Enter}"
End Sub
Sub k()
ActiveCell.Value = 4
SendKeys "{Enter}"
End Sub
Sub m()
ActiveCell.Value = 5
SendKeys "{Enter}"
End Sub
可以改下发来吗
何时有空啊?请尽快啊
追答
在该工作表中,插入一个文本框, 将文本框的Backstyle属性设定为0
在该工作表标签处右键,查看代码, 将如下代码粘贴过来
Public Tg As Range
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Debug.Print KeyCode
Select Case KeyCode
Case 65 To 71
Tg.Value = Chr(Val(KeyCode) + 32)
Tg.Activate
Application.SendKeys "~"
TextBox1 = ""
Case Else
Tg.Value = TextBox1.Text
Tg.Activate: Application.SendKeys "{F2}"
TextBox1.Visible = False: TextBox1 = ""
End Select
End Sub
'
'Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
' Select Case KeyAscii
' Case 97 To 103
' Tg.Value = Chr(KeyAscii)
' Tg.Activate
' Application.SendKeys "~"
' TextBox1.Text = ""
' Case Else
' Tg.Value = TextBox1.Text
' Tg.Activate: Application.SendKeys "{F2}"
' TextBox1.Visible = False: TextBox1.Text = ""
' End Select
'End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Tg = Target(1, 1)
With TextBox1
.Visible = True
.Top = Tg.Top
.Width = Tg.Width
.Height = Tg.Height
.Left = Tg.Left
.Activate
End With
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
按回车或TAB键
追问
我要自动跳,不按回车键
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询