im Archiv habe ich leider nichts passendes gefunden, ich hoffe ihr könnt mir trotzdem weiterhelfen,
ich habe hier ne Stoppuhr, die wenn die Zeit hochläuft nicht jede Zentel sekunde anzeigt.
Das möchte ich aber! wie bekomme ich es hin das sich die Stoppuhr jede Zentelsekunde anpass?
Danke für eure Hilfe
MFG
raphael
Hier mein Macro:
Option Explicit
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Dim starttime As Long, Wartezeit As Date
Public Sub Start()
starttime = timeGetTime
Anzeige
End Sub
Public Sub Lap()
Dim laptime As Long
laptime = timeGetTime - starttime
If starttime 0 Then MsgBox Long2HMS(laptime), 0, "Zwischenzeit"
End Sub
Public Sub Ende()
Dim stoptime As Long
stoptime = timeGetTime - starttime
If starttime 0 Then
Application.OnTime Wartezeit, "Anzeige", , False
Cells(2, 1).ClearContents
MsgBox Long2HMS(stoptime), 0, "Gesamtzeit."
End If
starttime = 0
End Sub
Private Sub Anzeige()
Dim displaytime As Long, datAktuell As Date
displaytime = timeGetTime - starttime
Cells(2, 1) = Long2HMS(displaytime)
Wartezeit = Now + TimeSerial(0, 0, 1)
Application.OnTime Wartezeit, "Anzeige"
End Sub
Private Function Long2HMS(lngT As Long) As String
Dim hh As Integer, mm As Integer, ss As Double
hh = lngT \ 360000: lngT = lngT - hh * 3600000
mm = lngT \ 60000: lngT = lngT - mm * 60000
ss = lngT / 1000#
Long2HMS = Format(hh, "00") & ":" & Format(mm, "00") & ":" & Format(ss, "00.0000")
End Function