I would like to round up or round down the duration to a whole day -- if the
duration is 10.1 thru 10.4 - I would like to display 10 days -- if the
duration is 10.5 - 10.9 - I would like to display 11 days. Thanks in advance
for your assistance.
Sharing the Journey
Couple of more points, I tried to write a macro to do the same job,
where the macro is using custom function instead of fix / round (which
is VB version specific)
*Steps*
1. Choose Tools | Macros | Macro (or) Alt + F8; Macros dialog box
should be displayed
2. Enter the name of the macro, say "RoundDuration"; you will observe
"Create" button is enabled
3. Paste the below code inside the function
Sub RoundDuration()
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.Duration = AsymUp(t.Duration / 480) * 480
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 duration. The
number 480 in the formula Round(t.Duration / 480) * 480 indicates the
number of minutes per day.
2. When the above macro is run, the work and assignment units may get
adjusted accordingly (see Task Type and Effort driven indicator)
3. Warning! The above code will overwrite the existing values in
duration column.
To run the macro visit Tools | Macros | Macro and run the macro.
I suggest you visit
http://support.microsoft.com/kb/196652; it has
list of custom code for different types of rounding.
- Sai, PMP, PMI-SP, MCT, MCTS
http://saipower.wordpress.com