房天下 > 房天下问答 > 业主生活 > 其他
  • Excel中如何判断按下了回车键

    Excel VBA编程中如何判断是否按下了某个按键呢?比如说回车键

    提问者:championzo

    发布于2010-12-14

共1个回答
  • 为爱痴心 丨Lv 4
    Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As IntegerSub keycodes()Dim x As Longx = GetKeyState(&HD) ' Enter's virtual key code is &H0DIf (x And &H80) = &H80 Then ' check to see if it is toggledDebug.Print "Enter is currently toggled."End IfIf (x And &H1) = &H1 Then ' check to see if it is depressedDebug.Print "Enter is currently depressed."End IfEnd Sub
    +10 2010-12-15 举报
热门人气推荐
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。