Using VBA to set a value in a custom field

K

kjwass53

For each task in a project I would like to be able to set a field
(let's say Text1) based on the contents of the Text2 fields in any
tasks that are predecessors (the immediate ones only). Can anyone
suggest a control structure for this? I know it would have something
like this in it...

Sub MySetField()
Dim MyProj As Project
Dim T As Task
MyProj = ActiveProject

For Each T In MyProj.Tasks

'check for predecessor tasks - if none then skip

'for each predecessor task
'check value of Text2
'logic to determine value Text1 (in the current task)
'end

' set value of Text1 in current task
End
End Sub

Thanks in anticipation,
Kevin
 
M

Mike Glen

Hi Kevin,

Try posting on the developer newsgroup. Please see FAQ Item: 24. Project
Newsgroups. FAQs, companion products and other useful Project information
can be seen at this web address: http://project.mvps.org/faqs.htm

Mike Glen
Project MVP
 

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