Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duration Stumper 1

Status
Not open for further replies.

Scott24x7

Programmer
Jul 12, 2001
2,825
JP
All,
If a project has a defined duration showing in Days, is it possible to show the duration instead in hours, without having to re-enter all the durations using <nnn>h for each field?


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
1. Make a backup copy of the project file.
2. Open the copy where you will make the changes.

3. This will fix the display of Summary tasks:

Tools | Options | Schedule-tab and set "Duration" to "Hours"


4. This will fix the display of Tasks:


4a. Alt+F11 to open VBA window
4b. Insert | Module

4c. Paste the following text into the code window:

Sub PDQBach()
Dim tsk As Task
For Each tsk In ActiveProject.Tasks
If Not tsk Is Nothing Then
If Not tsk.Summary Then
Debug.Print tsk.ID, tsk.Duration;
tsk.Duration = tsk.Duration / 60 & "H"
Debug.Print " after"; tsk.Duration
End If
End If
Next
End Sub

4d. Then click on Run in the VBA menu bar.
 
Wow... you'd think they'd make seeing the durations in some other time scale a bit, well, easier! I see the wisdome of your code though, thanks heaps for that.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top