VBA编写的EXCEL数字秒表
Option Explicit
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Public iTimerID As Long, timeX As Single
Public Sub OnTimer()
timeX = timeX + 0.1
UserForm1.TextBox1 = Format(timeX, "0.0")
End Sub
Sub ShowUserForm()
UserForm1.Show
End Sub