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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do i calculate hours/minutes in a billing format.
I have a template that i downloaded... i need to calculate the hours table so
that it multiplies as hours and minutes... |
#2
|
|||
|
|||
This may give you an idea about how to go about it:
' a Macro to calculate the elapsed time for formfields with Date format of HH:mm ' Start = ActiveDocument.FormFields("Text1").Result StartHour = Val(Left(Start, 2)) StartMinutes = Val(Right(Start, 2)) StartTimeMinutes = StartHour * 60 + StartMinutes Finish = ActiveDocument.FormFields("Text2").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("Text3").Result = Str(ElapsedHours) & ":" & Format(ElapsedMinutes, "00") -- Please respond to the Newsgroup for the benefit of others who may be interested. Questions sent directly to me will only be answered on a paid consulting basis. Hope this helps, Doug Robbins - Word MVP "msmo" wrote in message ... I have a template that i downloaded... i need to calculate the hours table so that it multiplies as hours and minutes... |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Changing the Date Format | xtian_princess | Worksheet Functions | 1 | September 8th, 2004 02:54 PM |
cannot change format of a field | DLJ | General Discussion | 5 | August 5th, 2004 09:05 PM |
"Format cells" not working | v matheson | General Discussion | 1 | July 26th, 2004 06:46 PM |
Find/Replace text, NOT format!!! | HennyBogan | General Discussion | 5 | June 21st, 2004 08:45 PM |
Format will not save! | Fred | General Discussion | 2 | June 15th, 2004 06:02 PM |