#1   Report Post  
Posted to microsoft.public.word.tables
KB-1 KB-1 is offline
external usenet poster
 
Posts: 4
Default Time sheets

Is it possible to make a time sheet in Word 2007 where each cell of a table
can be formatted to be based off the 12hr clock and total up the daily and
weekly hours?? I am not familiar with Word at all.
  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Time sheets

Word is definitely not the best tool for the job. However, using the Legacy
FormFields available in the Controls section of the Developer tab, and a
macro containing the following code run on exit from the formfield into
which the finish time is entered, the duration between the start and the
finish times will be calculated and appear in the Duration formfield.

' a Macro to calculate the elapsed time for formfields with Date format of
HH:mm

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

'

Dim Start as String, Finish as String

Dim StartHour as Long, StartMinutes as Long, StartTimeMinutes as Long

Dim FinishHour as Long, FinishMinutes as Long FinishTimeMinutes as Long

Dim Elapsed Minutes as Long, Elapsed Hours as Long

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

StartHour = Val(Left(Start, 2))

StartMinutes = Val(Right(Start, 2))

StartTimeMinutes = StartHour * 60 + StartMinutes

Finish = ActiveDocument.FormFields("Finish").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")


If I were creating a timesheet system that made use of Microsoft Office, I
would develop it in Access. Excel would be the next choice of application
and Word would be the last.

--
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

"KB-1" wrote in message
...
Is it possible to make a time sheet in Word 2007 where each cell of a
table
can be formatted to be based off the 12hr clock and total up the daily and
weekly hours?? I am not familiar with Word at all.



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
Format Date and Time to show Military Time AlanFD Microsoft Word Help 2 September 22nd 06 10:44 PM
Please Help me in Style Sheets Husain Nagri Microsoft Word Help 1 April 19th 06 10:40 AM
Style Sheets [email protected].(donotspam) Microsoft Word Help 3 July 28th 05 07:39 PM
Changing time on all sheets Lindsey Microsoft Word Help 2 June 1st 05 03:40 AM
New Blank sheets MEmmons504 New Users 1 March 1st 05 02:47 AM


All times are GMT +1. The time now is 01:08 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"