Application.OnKey "{F1}"
i = i + 1
Sheets("sheet1").Cells(i, 1) = "X="
Sheets("sheet1").Cells(i, 2) = Int((10 * Rnd) + 1)
End Sub
試了這個,但不成功...作者: cdkee 時間: 2010-10-6 19:10
Private Sub CommandButton1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
找到這個,但不懂有沒有關係...作者: cdkee 時間: 2010-10-6 20:15
Public i As Integer
Private Sub CommandButton1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = Asc("{F1}") Then
CommandButton1_Click
End If
End Sub
1. In design mode, select your CommandButton1;
2. In the Properties window, enter a single letter for the field Accelerator;
Suppose the caption of your CommandButton1 is “Fire” and a letter “r” is typed in step 2, then letter “r” will be underlined.
Other letters will be accepted but the underline will not shown in the caption.
Also note that it is different for lower and upper case letters.
To run your subroutine, press ALT+r or click CommandButton1 for the above example.
找到像樣的,但要按2個KEY,及FUNCTION KEY不能利用!
請教大大怎樣改,也可會做到?作者: GBKEE 時間: 2010-10-7 07:27