J
JinkyJulie via OfficeKB.com
Hi again...
I'm lost... I know that Word does not handle time calculation well... but I
do have some code someone graciously assisted me with... and it works BUT...
there are some minor issues that I cannot seem to fix....
Here goes....
Two tables.... Take time info from one table, calculate elapsed time and
send result to second table. Code to do that works great...
All times are in 24 hour, HH:mm format (03:47, 14:53, etc...)
Code has a problem if time is midnight (00:00) and get a Type Mismatch error
if the time is changed to 24:00.
Result is wrong if times are "simple"... (e.g. 06:26 and 04:31 results in 3:
51 elapsed time) I don't understand why...
nHr = DateDiff("h", CDate(StartTime), CDate(EndTime))
nMin = DateDiff("n", CDate(StartTime), CDate(EndTime))
ResultRange.Text = Format(nHr, "#") & ":" & Format(nMin Mod 60, "##")
Can someone please give me a hand??? I would really appreciate it...
Thanks as always....
Julie
I'm lost... I know that Word does not handle time calculation well... but I
do have some code someone graciously assisted me with... and it works BUT...
there are some minor issues that I cannot seem to fix....
Here goes....
Two tables.... Take time info from one table, calculate elapsed time and
send result to second table. Code to do that works great...
All times are in 24 hour, HH:mm format (03:47, 14:53, etc...)
Code has a problem if time is midnight (00:00) and get a Type Mismatch error
if the time is changed to 24:00.
Result is wrong if times are "simple"... (e.g. 06:26 and 04:31 results in 3:
51 elapsed time) I don't understand why...
nHr = DateDiff("h", CDate(StartTime), CDate(EndTime))
nMin = DateDiff("n", CDate(StartTime), CDate(EndTime))
ResultRange.Text = Format(nHr, "#") & ":" & Format(nMin Mod 60, "##")
Can someone please give me a hand??? I would really appreciate it...
Thanks as always....
Julie