Bandit0
Gebruiker
- Lid geworden
- 27 jul 2011
- Berichten
- 143
Hallo allemaal,
Ik wil gebruik maken van de onderstaande timer maar deze gaat nu automatisch bij een nieuwe meeting telkens 1 regel omlaag.
Weet iemand hoe ik het voor elkaar krijg dat het in plaats van omlaag 1 cel opschuift naar rechts?
Ik wil gebruik maken van de onderstaande timer maar deze gaat nu automatisch bij een nieuwe meeting telkens 1 regel omlaag.
Weet iemand hoe ik het voor elkaar krijg dat het in plaats van omlaag 1 cel opschuift naar rechts?
Code:
Option Explicit
Dim NextTick As Date, t As Date, PreviousTimerValue As Date
Sub StartTime()
PreviousTimerValue = Calculations.Range("A1").Value
t = Time
Call ExcelStopWatch
End Sub
Private Sub ExcelStopWatch()
Calculations.Range("A1").Value = Format(Time - t + PreviousTimerValue, "hh:mm:ss")
NextTick = Now + TimeValue("00:00:01")
If Calculations.Range("A1").Value > Calculations.Range("B3") And Calculations.Range("A1").Value <= Calculations.Range("B4") Then
With StopWatch.Shapes("TimeBox")
.Fill.ForeColor.RGB = RGB(255, 255, 255)
End With
Else
If Calculations.Range("A1").Value > Calculations.Range("B4") And Calculations.Range("A1").Value <= Calculations.Range("B5") Then
With StopWatch.Shapes("TimeBox")
.Fill.ForeColor.RGB = RGB(255, 255, 255)
End With
Else
If Calculations.Range("A1").Value > Calculations.Range("B5") Then
With StopWatch.Shapes("TimeBox")
.Fill.ForeColor.RGB = RGB(255, 255, 255)
End With
End If
End If
End If
Application.OnTime NextTick, "ExcelStopWatch"
End Sub
Sub StopClock()
On Error Resume Next
Application.OnTime earliesttime:=NextTick, procedure:="ExcelStopWatch", schedule:=False
End Sub
Sub Reset()
On Error Resume Next
With StopWatch.Shapes("TimeBox")
.Fill.ForeColor.RGB = RGB(255, 255, 255)
End With
If StopWatch.Range("F3") = "" And Calculations.Range("A1").Value > 0 Then
StopWatch.Range("F3").Value = 1
StopWatch.Range("F3").Offset(0, 1).Value = Calculations.Range("A1").Value
Else:
StopWatch.Range("F2").End(xlDown).Offset(1, 0).Value = StopWatch.Range("F2").End(xlDown).Value + 1
StopWatch.Range("F2").Offset(0, 1).End(xlDown).Offset(1, 0).Value = Calculations.Range("A1").Value
End If
Application.OnTime earliesttime:=NextTick, procedure:="ExcelStopWatch", schedule:=False
Calculations.Range("A1").Value = 0
End Sub