B
blackbox via OfficeKB.com
I have range of values in columns A & B which I would like to display 1 at a
time, at 1 second intervals in cells D4 and E4
I have some code but I'm not very good with loops.
How would I make this move from row 1 to row2 to row 3, etc.. at every 1
second re-fresh?
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1 ' 1 second
Public Const cRunWhat = "Run_Time_and_Sales"
Sub StartTimer()
If Range("F1") = "x" Then
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
Else: End
End If
End Sub
Sub Run_Time_and_Sales()
Dim LastPrint As Integer
Dim PrintTime As Integer
LastPrint = Range("A1").Value
PrinTime = Range("B1").Value
Range("D4") = LastPrint
Range("E4") = PrintTime
StartTimer
End Sub
time, at 1 second intervals in cells D4 and E4
I have some code but I'm not very good with loops.
How would I make this move from row 1 to row2 to row 3, etc.. at every 1
second re-fresh?
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1 ' 1 second
Public Const cRunWhat = "Run_Time_and_Sales"
Sub StartTimer()
If Range("F1") = "x" Then
RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
schedule:=True
Else: End
End If
End Sub
Sub Run_Time_and_Sales()
Dim LastPrint As Integer
Dim PrintTime As Integer
LastPrint = Range("A1").Value
PrinTime = Range("B1").Value
Range("D4") = LastPrint
Range("E4") = PrintTime
StartTimer
End Sub