Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

calculated finish date

Status
Not open for further replies.

Mindy343

Marine/Ocean
Jan 25, 2007
2
I need to create a formula/macro to display finish dates in a column for a project using the "As Late As Possible" constraint while keeping the "As soon As Possible" constraint on the task. Can anyone help?
 
Replies continue below

Recommended for you

Needed a different calculation for the late finish. I got bunches of help on Tek-Tips.Com Here is the link:


And the solution from tek-tips.com:

PDQBach (IS/IT--Management) 8 Aug 07 10:41
You cannot apply an ASAP constraint while simultaneously applying an ALAP constraint -- it's like saying you can have the same popsicle be a grape popsicle and a fudgsicle simultaneously.

Mindy343 (TechnicalUser) 8 Aug 07 11:05
I need to display a result that is similar to the "Late Finish Date" and can get it by using the "As Late As Possible" constraint and the late finish date column...the problem is that I need to keep the rest of the information as calculated with the "As Soon As Possible" constraint.

I hoped I could get some help writing a module to look at each task as ALAP, calculate the late finish date using that constraint and then display that result in a column...all without actually changing the constraint originally assigned to the task.

Mindy343 (TechnicalUser) 8 Aug 07 14:14
Would it be possible to Change the constaint to ALAP then have the new late finish saved in a date column then change the constraint back to ASAP?
I can Change the constraint with ---

Sub MakeALAP()
Dim T As Task

For Each T In ActiveProject.Tasks
If T.Summary = False Then
If T.ConstraintType = pjASAP Then
T.Text1 = T
T.ConstraintType = pjALAP
End If
End If
Next T

End Sub

and I can create a column "Date5" copy the Late Finish with ---

Sub MakeDate()
Dim T As Task
For Each T In ActiveProject.Tasks
T.Date5 = T.LateFinish

Next T

End Sub

I assume I can rewrite the first 'sub' to change it back to ASAP but I don't know how to put it together and run it as a whole module.

Sorry if I'm not making sense...but my boss says it can be done and wants me to figure it out so I've spent all day looking things up and am about to explode!


PDQBach (IS/IT--Management) 9 Aug 07 11:06
It looks to me as if you've done all the heavy lifting.

This code loops through the tasks, saves the current LateFinish, changes the ConstraintType to ALAP, saves the revised LateFinish, changes the ConstraintType back to the previous setting and moves to the next task.

Sub pdqbach()
Dim tsk As Task
Dim varConstraint As Variant

For Each tsk In ActiveProject.Tasks
If Not tsk Is Nothing Then
If Not tsk.Summary Then
tsk.Date5 = tsk.LateFinish
varConstraint = tsk.ConstraintType
tsk.ConstraintType = pjALAP
tsk.Date6 = tsk.LateFinish
tsk.ConstraintType = varConstraint
End If
End If
Next
end sub

Not sure what else you need done. Please advise.


Mindy343 (TechnicalUser) 10 Aug 07 11:29
You're my hero!!!

Need another constraint change. I also need any task with a desdline to change from ASAP to FNET before recording the revised Late Finish Date. Is this possible?


PDQBach (IS/IT--Management) 10 Aug 07 15:06
You can fit this logic into the other code:

if tsk.Deadline < 100000 then ' There is a deadline date
if tsk.ConstraintType = pjASAP then
tsk.ConstraintType = pjFNET
tsk.Date6 = tsk.Finish
tsk.ConstraintType = pjASAP
end if
else ' No deadline date
'
' do something else
'
end if

I'm curious ... what are you trying to accomplish with the code I've sketched out in this thread?


Mindy343 (TechnicalUser) 13 Aug 07 13:37
My boss wants to be able to get a late finish schedule that works backward from the deadline date rather than the project finish date. This is the only way I have found to get Project to calculate the results he wants to see but I just didn't have the expertise to put it into a single module. Your code is right on! Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor