¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-10-2 12:33 ½s¿è
Module1µ{¦¡½X- Option Explicit
- 'API¨ç¼Æ«Å§i
- '³]©wp®É¾¹¨ç¼Æ
- Declare Function SetTimer _
- Lib "user32" ( _
- ByVal hWnd As Long, _
- ByVal nIDEvent As Long, _
- ByVal uElapse As Long, _
- ByVal lpTimerFunc As Long) _
- As Long
- 'µ²¼Æp®É¾¹¨ç¼Æ
- Declare Function KillTimer _
- Lib "user32" ( _
- ByVal hWnd As Long, _
- ByVal nIDEvent As Long) _
- As Long
- '¶}©l²Ä¤@Óp®É¾¹
- 'EXCELµøµ¡ªºhandle, id³]¬°1, ¨C 0.2¬í°õ¦æ1¦¸Asubµ{§Ç
- Sub StartAsub()
- SetTimer Application.hWnd, 1, 200, AddressOf Asub
- End Sub
- 'µ²§ô²Ä¤@Óp®É¾¹
- Sub StopAsub()
- KillTimer Application.hWnd, 1
- End Sub
- '¶}©l²Ä¤GÓp®É¾¹
- 'EXCELµøµ¡ªºhandle, id³]¬°2, ¨C 0.5¬í°õ¦æ1¦¸Bsubµ{§Ç
- Sub StartBsub()
- SetTimer Application.hWnd, 2, 500, AddressOf Bsub
- End Sub
- 'µ²§ô²Ä¤GÓp®É¾¹
- Sub StopBsub()
- KillTimer Application.hWnd, 2
- End Sub
- 'Asub¦b§@¥Î¤u§@ªí¤§A1Àx¦s®æ²Ö¥[1
- Sub Asub()
- With ActiveSheet.Range("a1")
- .Value = .Value + 1
- End With
- End Sub
- 'Bsub¦b§@¥Î¤u§@ªí¤§B1Àx¦s®æ²Ö¥[1
- Sub Bsub()
- With ActiveSheet.Range("b1")
- .Value = .Value + 1
- End With
- End Sub
½Æ»s¥N½X Sheet1¼Ò²Õµ{¦¡½X- Option Explicit
- Private Sub CommandButton1_Click()
- StartAsub
- End Sub
- Private Sub CommandButton2_Click()
- StopAsub
- End Sub
- Private Sub CommandButton3_Click()
- StartBsub
- End Sub
- Private Sub CommandButton4_Click()
- StopBsub
- End Sub
½Æ»s¥N½X crdotlin«e½úªº¤À¨É
run2subs3.zip (18.96 KB)
|