Re: Collect, add times in a looped array?
- From: "Ed" <ed_millis@xxxxxxxxxxxxxxxxx>
- Date: Wed, 17 May 2006 06:35:59 -0700
HI, Helmut. I read through all the Helps on "Time", but didn't find
anything that addresses what I was thinking of. It's quite possible I
simply don't understand how to mesh what I read with what I want to do.
I scan plain text documents for data points and write the data into an Excel
spreadsheet. In one section of the document, there are lists of times.
These are not clock times as "3:45 pm", but the length of time a job took to
complete stated as "03:45", meaning 3 hours and 45 minutes.
I'm using an array because each line will have four different time spans.
My idea was to scan through a line, collect each time and write it to the
proper place in the array, then drop to the next line and add the time span
to the previous value. When I've reached the last line, the code will drop
out of the loop and the array values will be written to the spreadsheet.
All of this I can do, except for getting the times to simply be the
quantities of hours and minutes and add together as such. Everything I've
tried wants these to be clock times.
Any nudge you can give to put my thinking in the right direction will be
greatly appreciated.
Ed
"Helmut Weber" <nbhymsjxdgcn@xxxxxxxxxxxxxx> wrote in message
news:ni3m62lbo3ekrii4aq7dic3ddblt82c3sn@xxxxxxxxxx
Hi Ed,
first,
see help for "time",
time function and time statement
second, I miss the concept of reserved words in VBA,
this shouldn't be possible, IMHO.
Dim Time As Double
MsgBox Time
as opposed to, just:
MsgBox Time
Third,
this could become a long thread,
as in principle, adding times as 6 o'clock plus 9 o'clock,
time points, is meaningless.
A point in time is calculated from another point in time.
An absolute fix point is not available.
Time ("What time is it")
and time span ("How much time did you need?")
are something essentially different.
You may calculate with days, hours, minutes, seconds.
Beware, months and years are of varying lenght.
You may check, according to the precision you need,
how much seconds are between two points in time.
For time points in a day, e.g., leaving theory aside,
see: datediff function.
What is it You want to achieve?
To the best of my knowledge.
If someone knows better,
she or he will speak up.
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
.
- Follow-Ups:
- Re: Collect, add times in a looped array?
- From: Jay Freedman
- Re: Collect, add times in a looped array?
- From: Helmut Weber
- Re: Collect, add times in a looped array?
- References:
- Collect, add times in a looped array?
- From: Ed
- Re: Collect, add times in a looped array?
- From: Helmut Weber
- Collect, add times in a looped array?
- Prev by Date: Re: Option in TOC
- Next by Date: Re: Collect, add times in a looped array?
- Previous by thread: Re: Collect, add times in a looped array?
- Next by thread: Re: Collect, add times in a looped array?
- Index(es):
Relevant Pages
|