Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
macropod
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on sce

Hi Christy,

To see how to do this and just about everything else you might want to do
with dates in Word, check out the topic 'Add Or Subtract Two Time Periods'
in my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902

Cheers


"HCFRAdmin" wrote in message
...
Tony,
That would be great, if only I knew how to create Macros. I thought there
would be a formula that I could use without getting too technical. Macros
are probably your second language, however, I don't know how to create or

use
them. I'm sorry. Perhaps I should start there, huh?

Christy

"Tony Jollans" wrote:

If you're not going to bother with any validation then this would be a
little simpler ..

With ActiveDocument
.FormFields("Duration").Result _
= Format(CDate(.FormFields("FinishTime").Result) _
- CDate(.FormFields("StartTime").Result), "h:mm")
End With

--
Enjoy,
Tony


"Doug Robbins - Word MVP" wrote in message
...
' Macro to calculate the elapsed time for formfields with Date format

of
HH:mm

' Macro created 16 May 1999 by Doug Robbins - Word MVP

'

Start = ActiveDocument.FormFields("StartTime").Result

StartHour = Val(Left(Start, 2))

StartMinutes = Val(Right(Start, 2))

StartTimeMinutes = StartHour * 60 + StartMinutes

Finish = ActiveDocument.FormFields("FinishTime").Result

FinishHour = Val(Left(Finish, 2))

FinishMinutes = Val(Right(Finish, 2))

FinishTimeMinutes = FinishHour * 60 + FinishMinutes

ElapsedMinutes = FinishTimeMinutes - StartTimeMinutes

ElapsedHours = Int(ElapsedMinutes / 60)

ElapsedMinutes = ElapsedMinutes - ElapsedHours * 60

ActiveDocument.FormFields("Duration").Result = Str(ElapsedHours) & ":"

&
Format(ElapsedMinutes, "00")


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"HCFRAdmin" wrote in message
...
I am creating forms to be filled out on the computer and then emailed

to
me.
I am trying to create a formula in a table that can tell us how many
minutes
(hours and minutes) that our personnel spent on a scene. For

example:
I
have a box that they can enter their "Response Time" in and then I

have
another box where they can enter "Time Clear of Scene". I want a

formula
in
the following cell to total the amount of hours and minutes they

spent
at
this certain call. How do I do this? Help? Please??? Thanks in
advance!

Christy







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
The WordPerfect "Reveal Codes" method is so much easier to use. Torden Microsoft Word Help 8 April 19th 10 07:50 PM
take yet another lesson from wordperfect "reveal codes" wordperfect is superior Microsoft Word Help 5 May 11th 09 07:58 PM
is word perfect compatible with office word? Noreen Microsoft Word Help 1 May 11th 05 11:17 PM
Envelope Address GR New Users 5 April 24th 05 09:48 PM


All times are GMT +1. The time now is 04:47 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"