From: drjayr2002 on 26 Jan 2010 15:05 I need help in formating the work hours showing rounded off to next hr, rather than showing with one decimal. Appreciate help
From: Andrew Lavinsky on 26 Jan 2010 15:48 What about using the Round function? Round([Field],0) - or something like that syntax. - Andrew Lavinsky Blog: http://blogs.catapultsystems.com/epm > I need help in formating the work hours showing rounded off to next > hr, rather than showing with one decimal. Appreciate help >
From: Dave on 26 Jan 2010 16:11 On Jan 26, 2:05 pm, drjayr2002 <drjayr2...(a)discussions.microsoft.com> wrote: > I need help in formating the work hours showing rounded off to next hr, > rather than showing with one decimal. Appreciate help There is no way to change then number of decimal places in the Work field. You could insert a custom text field and use the formula: Round([Work]/60) & " hrs"
From: Sai on 27 Jan 2010 03:53 On Jan 27, 1:05 am, drjayr2002 <drjayr2...(a)discussions.microsoft.com> wrote: > I need help in formating the work hours showing rounded off to next hr, > rather than showing with one decimal. Appreciate help Yes, you can do it using macros. Note, you don't need to be an expert to understand the below code. *Steps* 1. Choose Tools | Macros | Macro (or) Alt + F8; Macros dialog box should be displayed 2. Enter the name of the macro, say "RoundWork"; you will observe "Create" button is enabled 3. Paste the below code inside the function Sub RoundWork() Dim ts As Tasks Dim t As Task Set ts = ActiveProject.Tasks For Each t In ts If Not t Is Nothing Then If Not t.Summary Then t.work = AsymUp(t.work/ 60) * 60 End If End If Next t End Sub Function AsymUp(ByVal X As Double, _ Optional ByVal Factor As Double = 1) As Double Dim Temp As Double Temp = Int(X * Factor) AsymUp = (Temp + IIf(X = Temp, 0, 1)) / Factor End Function 4. Save the macro. *How it works?* 1. The above code gets the list of tasks in the *active* project and if it is not a summary task, it rounds its current work. The number 60 in the formula AsymUp(t.Duration / 60) * 60 indicates the number of minutes per hour. 2. When the above macro is run, the duration and assignment units may get adjusted accordingly (see Task Type and Effort driven indicator) 3. I have written a custom function AsymUp(), and not used Round() or Fix(). Round() rounds to the next hour only if the its decimal value is greater than 0.5 and also Fix() will be truncate the decimal values. 3. Warning! The above code will overwrite the existing values in work column. To run the macro visit Tools | Macros | Macro and run the macro. Please let us know if this helps. - Sai, PMP, PMI-SP, MCT, MCTS http://saipower.wordpress.com
|
Pages: 1 Prev: How to Copy Macros Next: how do i reset the Unique ID field in Project 2003? |