Forum Discussion
Polestar2021
Mar 22, 2022Copper Contributor
Number of assigned resources on tasks
Someone know how to set up a new column to show me the number of assigned resources on tasks? In column Tekst 1 i have drawn numbers in red just for an example. And also i would like to have a colu...
- Mar 24, 2022Polestar2021,
You're welcome and thanks for the feedback.
What exactly do you mean by, "place out resources"? And I'm confused about you desire to show a list of resources not assigned to a task yet. At the top of the Resource Usage view you can see a list of unassigned resources but, those resources may or may not be appropriate for assignment to any given task.
With respect to removing decimals in the days column, if you simply want a whole number of days then replace the t.Text1 line with this:
t.Text1 = Format(t.Duration / 60 / ActiveProject.HoursPerDay, "##") & " days"
John
Polestar2021
Mar 22, 2022Copper Contributor
Hi, and thank you for answer!
I have set the working time for 7.5 hours into days(37.5 in weeks)
I have set the working time for 7.5 hours into days(37.5 in weeks)
John-project
Mar 22, 2022Silver Contributor
Polestar2021,
Thanks for the information but I still don't get 19 days for 315.44 hours. Is the red 19 just a placeholder and not meant to represent a real value?
John
Thanks for the information but I still don't get 19 days for 315.44 hours. Is the red 19 just a placeholder and not meant to represent a real value?
John
- Polestar2021Mar 23, 2022Copper Contributorsorry, red 19 is put on wrong place, i think the correct number will be 42, because 315 divided on 7,5 is 42
- John-projectMar 23, 2022Silver ContributorPolestar2021,
Okay, that now makes sense. I'll work on it and post back when I have something.
A side question, what is the reason you want a separate field to show the day equivalent for the hours in the Duration field? If you indeed want both, I can do that in the macro I'll write for you but if you want to change the units shown in the Duration field, I can point you to a macro that will do that.
John- John-projectMar 24, 2022Silver ContributorBjorn,
This macro will do what you want. Note, it counts all assignments for each task, including assignments that are non-labor (e.g. material or cost resources). If you have multiple resource types assigned to tasks and you only want a count of labor (i.e. work type) resources,, the macro will need to be modified.
Sub ResCountPlus()
'This macro writes the number of task assignments into Text1
' and writes the number of working days for each task into Text2
Dim t As Task
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If t.Assignments.Count > 0 Then
t.Text2 = t.Assignments.Count
End If
t.Text1 = t.Duration / 60 / ActiveProject.HoursPerDay & " days"
End If
Next t
End Sub
John