看板 Visual_Basic 關於我們 聯絡資訊
想在excel使用keydown功能結果一直沒反應 寫了一個簡單的測試程式對按F鍵反應 結果compile顯示使用者自訂型態尚未定義 請問這該如何解決 Private Sub Worksheet_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = vbKeyF Then 'check if the user has pressed the F key MsgBox "You pressed the F key!" 'display a message box End If End Sub -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.22.200.117 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1681793425.A.D63.html
waiter337: If KeyCode = 70 Then 04/20 22:22
謝謝, 但改成70結果還是依樣未定義耶 ※ 編輯: sinlin (218.166.70.212 臺灣), 04/24/2023 08:45:40
ShoterMan: 我自己測試 用 onkey 勉強可行 05/26 11:03