D
David Fisher
Finally got Time Quick Enter to work in an "New" Template workbook, but
have these problem.
It will fill in time up to column FJ only which is only 60 columns.
Any columns after this col will only give me a number (1234) compare to
12:34:00 only even thou the col textbox was format with "MyTimeCols" at
the beginning before any VB. code was added to the sheet. This means I
have 15 columns that will not work.
Is there a limit on the numbers of columns that will work with "Time
Quick Enter"?
Is it a bug with office "2003"?
Also, if I add the following script to calculate the runtime down to the
seconds between points, "MyTimeCols" does not work for any columns at
all.
Function RunTime(EndTime As Range) As Double
Dim StartTime As Double
Dim org As Range
Dim STstr As String, ETstr As String
Dim stH As Long, stMIN As Long, stSEC As Long
Dim etH As Long, etMIN As Long, etSEC As Long
Dim col As Long, EndCol As Long, rw As Long
Dim i As Long
Const startCol = 19 'Column S
Const LabelRow = 4
Dim temp As Double
Dim ar
Const c1 = "Bus Depart at", c2 = "Stop #" 'this defines the Start
Time
ar = Array(c1, c2)
EndCol = EndTime.Column - 1
rw = EndTime.Row
If EndTime.Value = 0 Then
RunTime = 0
Exit Function
End If
If Not IsNumeric(EndTime.Value) Then Exit Function
If EndTime = 0 Then
RunTime = 0
Exit Function
End If
StartTime = 0
For col = startCol To EndCol
If InStr(1, Cells(LabelRow, col), c1) + _
InStr(1, Cells(LabelRow, col), c2) > 0 Then
StartTime = Cells(rw, col).Value
End If
If StartTime > 0 Then Exit For
Next col
If StartTime = 0 Then
RunTime = 0
Exit Function
End If
STstr = Format(StartTime, "00:00:00")
ETstr = Format(EndTime, "00:00:00")
stH = Left(STstr, 2)
stMIN = Mid(STstr, 3, 2)
stSEC = Right(STstr, 2)
etH = Left(ETstr, 2)
etMIN = Mid(ETstr, 3, 2)
etSEC = Right(ETstr, 2)
temp = TimeSerial(etH, etMIN, etSEC) - TimeSerial(stH, stMIN, stSEC)
RunTime = CDbl(Format(temp, "hh:mm:ss"))
End Sub
How do I get around these problem?
Thanks
have these problem.
It will fill in time up to column FJ only which is only 60 columns.
Any columns after this col will only give me a number (1234) compare to
12:34:00 only even thou the col textbox was format with "MyTimeCols" at
the beginning before any VB. code was added to the sheet. This means I
have 15 columns that will not work.
Is there a limit on the numbers of columns that will work with "Time
Quick Enter"?
Is it a bug with office "2003"?
Also, if I add the following script to calculate the runtime down to the
seconds between points, "MyTimeCols" does not work for any columns at
all.
Function RunTime(EndTime As Range) As Double
Dim StartTime As Double
Dim org As Range
Dim STstr As String, ETstr As String
Dim stH As Long, stMIN As Long, stSEC As Long
Dim etH As Long, etMIN As Long, etSEC As Long
Dim col As Long, EndCol As Long, rw As Long
Dim i As Long
Const startCol = 19 'Column S
Const LabelRow = 4
Dim temp As Double
Dim ar
Const c1 = "Bus Depart at", c2 = "Stop #" 'this defines the Start
Time
ar = Array(c1, c2)
EndCol = EndTime.Column - 1
rw = EndTime.Row
If EndTime.Value = 0 Then
RunTime = 0
Exit Function
End If
If Not IsNumeric(EndTime.Value) Then Exit Function
If EndTime = 0 Then
RunTime = 0
Exit Function
End If
StartTime = 0
For col = startCol To EndCol
If InStr(1, Cells(LabelRow, col), c1) + _
InStr(1, Cells(LabelRow, col), c2) > 0 Then
StartTime = Cells(rw, col).Value
End If
If StartTime > 0 Then Exit For
Next col
If StartTime = 0 Then
RunTime = 0
Exit Function
End If
STstr = Format(StartTime, "00:00:00")
ETstr = Format(EndTime, "00:00:00")
stH = Left(STstr, 2)
stMIN = Mid(STstr, 3, 2)
stSEC = Right(STstr, 2)
etH = Left(ETstr, 2)
etMIN = Mid(ETstr, 3, 2)
etSEC = Right(ETstr, 2)
temp = TimeSerial(etH, etMIN, etSEC) - TimeSerial(stH, stMIN, stSEC)
RunTime = CDbl(Format(temp, "hh:mm:ss"))
End Sub
How do I get around these problem?
Thanks