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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Customized finish date column 1

Status
Not open for further replies.

Mindy343

Technical User
Sep 9, 2004
35
US
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?
 
You cannot apply an ASAP constraint while simultaneously applying an ALAP constraint -- it's lime saying you can have the same popsicle be a grape popsicle and a fudgsicle simultaneously.

 
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.
 
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!
 
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.

 
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?
 
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?
 
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

Back
Top