Easy, you hire me since I have a macro that does it (hee hee)
Here is some guidance. First, since this is a VBA type question you should
be posting on our sister group microsoft.public.projectdeveloper. Happy to
help here, but please post additional questions over there.
You need to deceide on the rules you want to apply beofre you change the
line. Here is some of what I use
(Foregive me on the syntax, you will get the idea)
Dim myProj as ActiveProject
DIm pTask as Task
For each pTask in myProject.Tasks
If not pTask is nothing then (don't check blank lines)
If pTask.External=False (don't check external lines in the file)
If pTask.Summary=False (you probably want to skip summaries for what you are
requesting)
'These are all separate stand alone IF-THENs...
If pTask.Start< myProj.Status Date .... it should have started, check for
[Actual Start]
If pTask.Finish<myProj.Status Date .... it should have finished, check for
[Actual Finish]
If pTask.Start <=myProj.StatusDate AND pTask.Finish>=myProj.StatusDate
....update %Complete needed
Check there are not [Actual Start] or [Actual Finish] greater than the
status date (Nothing happens tomorrow)
End If 'Summaries
End If 'Externals
End If 'Task is nothing
Next pTask
Closing Comment on "If it is late..." I have some rants about this on my
blog... you should be looking at SPI. However, if you are using %Complete
for progress then use pTask.Status which returns an integer value if the
task is Late, On Schedule, Complete or Future Task.
The members of pjStatusType are:
pjComplete = 0
pjFutureTask=3
pjLate=2
pjNoData=4
pjOnSchedule=1
HTH
--
If this post was helpful, please consider rating it.
Jim Aksel, MVP
Check out my blog for more information:
http://www.msprojectblog.com