

Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!


Sub PERT() Dim tskT As Task Dim tskFirst As Task Dim FoundBadWeights As Boolean Dim UseOneSetofWeights As Boolean UseOneSetofWeights = True FoundBadWeights = False CustomFieldRename FieldID:=pjCustomTaskDuration1, NewName:="Optimistic Duration" CustomFieldRename FieldID:=pjCustomTaskDuration2, NewName:="Most Likely Duration" CustomFieldRename FieldID:=pjCustomTaskDuration3, NewName:="Pessimistic Duration" CustomFieldRename FieldID:=pjCustomTaskNumber1, NewName:="Optimistic Weight" CustomFieldRename FieldID:=pjCustomTaskNumber2, NewName:="Most Likely Weight" CustomFieldRename FieldID:=pjCustomTaskNumber3, NewName:="Pessimistic Weight" CustomFieldRename FieldID:=pjCustomTaskText30, NewName:="PERT State" If UseOneSetofWeights = True Then Set tskFirst = ActiveProject.Tasks(1) For Each tskT In ActiveProject.Tasks If Not (tskT Is Nothing) Then If tskT.PercentComplete = 0 And tskT.PercentWorkComplete = 0 Then If (tskFirst.Number1 + tskFirst.Number2 + tskFirst.Number3) = 6 Then tskT.Duration = ((((tskT.Duration1) * tskFirst.Number1) _
tskT.Text30 = "Duration Calc'd: " & Now() Else tskT.Text30 = "Not Calc'd: Weights <> 6" FoundBadWeights = True End If Else tskT.Text30 = "Not Calc'd: Task In Progress or Complete" End If End If Next tskT End If If FoundBadWeights = True Then MsgBox Prompt:="Some Tasks Weight Values were found to be incorrect." & _ Chr(13) & "Check the Text30 fields for details.", Buttons:=vbCritical, _ Title:="WorkPERT Weights Error" End If End Sub