A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Working with formulas in Word tables - calculating time on scene.



 
 
Thread Tools Display Modes
  #1  
Old January 12th, 2006, 07:02 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on scene.

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
  #2  
Old January 12th, 2006, 09:49 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on scene.

' 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



  #3  
Old January 12th, 2006, 10:40 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on scene.

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





  #4  
Old January 12th, 2006, 11:57 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on sce

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






  #5  
Old January 13th, 2006, 12:39 AM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on sce

The macros have been created for you by Doug and Tony. See
http://www.gmayor.com/installing_macro.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"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






  #6  
Old January 13th, 2006, 02:01 AM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default Working with formulas in Word tables - calculating time on sce

Sorry Christie,

As you say, macros are a sort of second language to me and I forget that
they are completely alien to others

Suzanne has pointed you to instructions for installing them - I hope it goes
well.

It would be possible to concoct a formula but it would be longer than the
code and you really wouldn't like it. If that is what you would like, please
come back.

--
Enjoy,
Tony


"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







  #7  
Old January 21st, 2006, 06:28 AM posted to microsoft.public.word.tables
external usenet poster
 
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







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
take yet another lesson from wordperfect "reveal codes" wordperfect is superior General Discussion 5 May 11th, 2009 07:58 PM
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th, 2005 06:54 PM
word and wordperfect mail merges slgcms Mailmerge 2 September 27th, 2005 02:13 PM
is word perfect compatible with office word? Noreen General Discussion 1 May 11th, 2005 11:17 PM
Word 2000/2002 - Proper Mail Merge steps for ODBC? Tony_VBACoder Mailmerge 7 September 2nd, 2004 09:21 PM


All times are GMT +1. The time now is 06:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.