S
Sinister
I found this code on a previous post:
Sub DateRngwActuals()
Dim t As Task
Dim a As Assignment
Dim st As Date, fin As Date
Dim ActW As TimeScaleValues
Dim i As Integer
ViewApply Name:="gantt chart"
st = InputBox("Enter start date of range", "Actuals for period")
fin = InputBox("Enter finish date of range", "Actuals for period")
For Each t In activeproject.Tasks
If Not t Is Nothing Then
t.Flag1 = False
Set ActW = t.TimeScaleData(StartDate:=st, EndDate:=fin, _
Type:=pjTaskTimescaledActualWork,
timescaleunit:=pjTimescaleWeeks)
For i = 1 To ActW.count
If ActW(i).Value <> "" Then
t.Flag1 = True
Exit For
End If
Next i
End If
Next t
FilterEdit Name:="Actuals", taskfilter:=True, create:=True,
overwriteexisting:=True, _
FieldName:="flag1", test:="equals", Value:="yes", ShowInMenu:=False,
showsummarytasks:=False
FilterEdit Name:="Actuals", taskfilter:=True, operation:="and", _
newfieldname:="summary", test:="equals", Value:="no"
FilterApply Name:="Actuals"
End Sub
It's perfect except I need to see it in the resource usage view and I'd like
the filter to be called Weekly Assignments
Sub DateRngwActuals()
Dim t As Task
Dim a As Assignment
Dim st As Date, fin As Date
Dim ActW As TimeScaleValues
Dim i As Integer
ViewApply Name:="gantt chart"
st = InputBox("Enter start date of range", "Actuals for period")
fin = InputBox("Enter finish date of range", "Actuals for period")
For Each t In activeproject.Tasks
If Not t Is Nothing Then
t.Flag1 = False
Set ActW = t.TimeScaleData(StartDate:=st, EndDate:=fin, _
Type:=pjTaskTimescaledActualWork,
timescaleunit:=pjTimescaleWeeks)
For i = 1 To ActW.count
If ActW(i).Value <> "" Then
t.Flag1 = True
Exit For
End If
Next i
End If
Next t
FilterEdit Name:="Actuals", taskfilter:=True, create:=True,
overwriteexisting:=True, _
FieldName:="flag1", test:="equals", Value:="yes", ShowInMenu:=False,
showsummarytasks:=False
FilterEdit Name:="Actuals", taskfilter:=True, operation:="and", _
newfieldname:="summary", test:="equals", Value:="no"
FilterApply Name:="Actuals"
End Sub
It's perfect except I need to see it in the resource usage view and I'd like
the filter to be called Weekly Assignments