Macro for deleting hours prior to status date

V

VSAT Ryan

Hello Everyone,

We are trying to develop a macro that will delete hours for all resource
assignments prior to the status date set by the user. Can anyone provide
some guidance or assistance in this?

Regards,
Ryan
 
V

VSAT Ryan

We are using a number column to manage our percent complete, rather than the
% complete column. Our cost system gets the ETC data in MSP from the "Work"
column, rather than the "Remaining Work" Column (and cannot be changed).
When I enter an actual finish date, the work value stays at a positive,
leading to unnecessary ETC growth in the cost system. If we can just delete
the hours prior to the status date, then the 2 apps will be better integrated.

Ryan
 
J

Jim Aksel

Personal opinion, it seems better to use the fields as they are intended and
not try to circumvent the software. This causes nothing but problems down the
road, for example the problem you are having right now. But that's not your
question, so...

You can wrtie a macro that will loop through all the tasks. The way I would
approach it would be something like this:

dim tsk as task
for each tsk in activeproject.tasks
if tsk.finish=tsk.actualfinish then
tsk.work=0
else
'do nothing
end if
next tsk

That should get you started.
You can also test on "actual finish" does not equal "NA" but then you may
run into localization issues. We do know for certain that if there exists an
ActaulFinish date then the actualfinish and finish will equal.

There may be one other catch, you may also need to look at setting
%Complete, %WorkComplete, and Physical%Complete all equal to 100 as well. It
will depend on how you are statusing the project. Noramally, if ActualFinish
is a real date then MS Project will set %Complete to 100% for you.

Code a little, test a lot.
--
If this post was helpful, please consider rating it.

Jim Aksel, MVP

Check out my blog for more information:
http://www.msprojectblog.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top