Regular Hours

T

Tim

hi,
I would like to write a macro to write assigned work to a particular resource.
I have not located anything that will let you write to the field. I tried to
record keystrokes with a macro, but no luck.

tks

tim
 
J

John

Tim,
There are several ways to do what you want. The best method to use
depends on several factors (e.g. how will the particular resource be
identified, how will the assigned work value be input, etc.). However to
get you started, the following simple macro will allow you to input a
resource name and then enter a work value for each assignment of that
resource. If the work value is left blank (i.e. no entry) the current
work value for that assignment will remain.

Sub assign_res()
ResNam = InputBox("Enter resource name")
Set Res = ActiveProject.Resources(ResNam)
For Each A In Res.Assignments
If Not A Is Nothing Then
ResWrk = InputBox("Enter " & ResNam & "'s work value for: " &
A.TaskName)
A.Work = ResWrk
End If
Next A
End Sub

Hope this helps.
John
 

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