How do I get assigned work by resource by month

B

Bobby

I want to get a report that looks like the following:

Name Month Month Month Month
==============================
Jeff 160hrs 160hrs 160hrs 160hrs
Susie 160hrs 160hrs 160hrs 160hrs
Bob 80hrs 80hrs 80hrs 80hrs

I am wondering if I still sue the TimescaleData method and how I change it
to pull back the information
 
J

John

Bobby said:
I want to get a report that looks like the following:

Name Month Month Month Month
==============================
Jeff 160hrs 160hrs 160hrs 160hrs
Susie 160hrs 160hrs 160hrs 160hrs
Bob 80hrs 80hrs 80hrs 80hrs

I am wondering if I still sue the TimescaleData method and how I change it
to pull back the information

Bobby,
Boy, everybody needs a lawyer these days because our society is so
litigation crazy. My guess is the court will throw out your suit but if
you really want to waste taxpayer money then go ahead (sigh).

Now that I've pointed out your failure to proofread, let me answer your
question. Why not simply use (or perhaps sue) the Task or Resource Usage
view? Either one will provide assigned work by resource by month (or
other time period). If for some reason you need to create a report with
VBA, then yes, the TimescaleData Method is the approach to take.

I don't know what you mean when you say, ". . . change it to pull back
the information". The example you show looks like straight resource
usage information - unrelated to the assignment. That would suggest
using "pjResourceTimescaleData" with "pjResourceTimescaledWork" as the
data type. However without a more definitive example and a little more
information, it is difficult to provide a more specific answer.

John
 
B

Bobby

John I am trying to return to excel the timescaled values for each resource
regardless of assignment, looking only for data as per;
Name Month Month Month Month
==============================
Jeff 160hrs 160hrs 160hrs 160hrs
Susie 160hrs 160hrs 160hrs 160hrs
Bob 80hrs 80hrs 80hrs 80hrs

and I'm using the following code to try and do it with
==================================================
For Each TSV In ActiveProject.Resource.TimeScaledData( _
StartDate:=ActiveProject.ProjectStart, _
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjResourceTimescaleWork, _
TimescaleUnit:=pjTimescaleMonths, _
Count:=1)
xlRng = TSV.StartDate
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -(colctr + 1))
For Each R In ActiveProject.Resources
If Not R Is Nothing And R.Summary = False And R.Milestone = False Then
If R.PercentComplete <> 0 And R.Work <> 0 And R.Work <> 0 Then
First = R.Start
Last = R.Finish
Yr = Year(R.Start)
mo = Month(R.Start)
xlRng = R.Name
Set xlRng = xlRng.Offset(0, 1)
Set taskhrs = R.TimeScaleData(First, Last, _
Type:=pjResourceTimescaledWork,
TimescaleUnit:=pjTimescaleMonths)
For i = 1 To taskhrs.Count
'GoSub WrkHrsMonth
EqHds = taskhrs(i).Value / 60 / 7 ' / WkDay
xlRng = Format(EqHds, "##0.00")
Set xlRng = xlRng.Offset(0, 1)
If mo = 12 Then
mo = 1
Yr = Yr + 1
Else
mo = mo + 1
End If

Next i
Set xlRng = xlRng.Offset(1, -i)
Else
Set xlRng = xlRng.Offset(0, 0)
End If
End If
Next R

Thanks
 
J

John

Bobby said:
John I am trying to return to excel the timescaled values for each resource
regardless of assignment, looking only for data as per;
Name Month Month Month Month
==============================
Jeff 160hrs 160hrs 160hrs 160hrs
Susie 160hrs 160hrs 160hrs 160hrs
Bob 80hrs 80hrs 80hrs 80hrs

and I'm using the following code to try and do it with
==================================================
For Each TSV In ActiveProject.Resource.TimeScaledData( _
StartDate:=ActiveProject.ProjectStart, _
EndDate:=ActiveProject.ProjectFinish, _
Type:=pjResourceTimescaleWork, _
TimescaleUnit:=pjTimescaleMonths, _
Count:=1)
xlRng = TSV.StartDate
Set xlRng = xlRng.Offset(0, 1)
colctr = colctr + 1
Next
Set xlRng = xlRng.Offset(1, -(colctr + 1))
For Each R In ActiveProject.Resources
If Not R Is Nothing And R.Summary = False And R.Milestone = False
Then
If R.PercentComplete <> 0 And R.Work <> 0 And R.Work <> 0 Then
First = R.Start
Last = R.Finish
Yr = Year(R.Start)
mo = Month(R.Start)
xlRng = R.Name
Set xlRng = xlRng.Offset(0, 1)
Set taskhrs = R.TimeScaleData(First, Last, _
Type:=pjResourceTimescaledWork,
TimescaleUnit:=pjTimescaleMonths)
For i = 1 To taskhrs.Count
'GoSub WrkHrsMonth
EqHds = taskhrs(i).Value / 60 / 7 ' / WkDay
xlRng = Format(EqHds, "##0.00")
Set xlRng = xlRng.Offset(0, 1)
If mo = 12 Then
mo = 1
Yr = Yr + 1
Else
mo = mo + 1
End If

Next i
Set xlRng = xlRng.Offset(1, -i)
Else
Set xlRng = xlRng.Offset(0, 0)
End If
End If
Next R

Thanks

Bobby,
Where did you get this code? Parts of it look exactly like something I
posted on the newsgroup some time ago. However in order to troubleshoot
your variation it would be a LOT easier to see your whole macro.
Otherwise I would have to fill in some blank spots and do some test
runs. Also, what exactly is or isn't your code doing?

If you want me to look at it further, you can zip it and send it to me
directly. It would also be helpful to run it on your actual file if that
can be provided. Unfortunately I don't have time to work on it tonight,
but if you send the whole macro, I will probably have time to look at it
in the morning.

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