|
请帮我把时间显示改为精确到毫秒,谢谢。
Sub delay(T As Single)
Dim T1 As Single
T1 = Timer
Do
DoEvents
Loop While Timer - T1 < T
End Sub
Sub Tmm()
Do
For i = 6 To 25
If Cells(i, 4) = 1 Then
Cells(i, 3) = Cells(i, 3) + TimeSerial(0, 0, 1)
End If
Next
delay 1
If [d26] = 0 Then Exit Do
Loop
End Sub
Sub tstart()
i = Application.Caller
If Sheet1.Cells(i + 5, 4) <> 1 Then
Sheet1.Cells(i + 5, 4) = 1
End If
Tmm
End Sub
Sub tstop()
i = Application.Caller
Sheet1.Cells(i - 100 + 5, 4) = 0
End Sub
Sub createbtn() '创建按钮
f = 1 '仅首次使用
If f = 1 Then Exit Sub
For i = 1 To 20
With ActiveSheet.Buttons.Add(200, 86 + (i - 1) * 30, 50, 25)
.Name = i
.Caption = "开始"
.OnAction = "tstart"
End With
With ActiveSheet.Buttons.Add(260, 86 + (i - 1) * 30, 50, 25)
.Name = i + 100
.Caption = "结束"
.OnAction = "tstop"
End With
Next
End Sub
Sub removebtn() '删除按钮
Sheet1.Buttons.Delete
End Sub
Sub reset()
[c6:d25] = 0
End Sub
|
|