D
Darrell
In the Resource Usage view I recorded a macro where I simply changed a single
value from 8hrs to 0 hrs for a selected resource and selected assignment. I
then modified this macro to change all values in a date range to 0hrs for the
same assignment. And, for that one assignment it worked great – it zeroed all
values in the date range I entered. However, I could not make this same macro
work on another assignment when I changed the UID field to a different
assignment. Here is what I started with and what I modified it too. I do not
understand why I cannot change the UID field and rerun the macro on a
different assignment. I need someone who knows more than me, well that
probably includes everyone in this news group, to help me understand what I
am missing so that I can do a one-time fix on a schedule I inherited. Any and
all input will be greatly appreciated.
Original Macro –
Sub Test_2()
' Macro Post
' Macro Recorded Tue 10/28/08 by MCIGOV\dmarkham.
ActiveProject.Resources.UniqueID(453).Assignments.UniqueID(2097263).TimeScaleData(StartDate:="7/2/07
12:00 AM", EndDate:="7/3/07 12:00 AM", Type:=8, TimeScaleUnit:=4,
Count:=1).Item(1).Value = "0"
SelectTimescaleRange Row:=140, StartTime:="Tue 7/3/07", Width:=1,
Height:=1
End Sub
Changed to -
Sub Test2()
' Macro Test2
' Macro Recorded Tue 10/28/08 by MCIGOV\dmarkham.
Dim tsv As TimeScaleValue
Dim tsvs As TimeScaleValues
Set tsvs =
ActiveProject.Resources.UniqueID(453).Assignments.UniqueID(2097263).TimeScaleData(StartDate:="7/2/07
12:00 AM", EndDate:="9/6/08 12:00 AM", Type:=8, TimeScaleUnit:=4, Count:=1)
For Each tsv In tsvs
tsv.Value = "0"
Next tsv
End Sub
Like I said this worked great for the assignment I originally recorded the
macro for… I need it to work for any assignment I select by whatever method
is best so that I can remove some bad data and re-enter it work the correct
values in an Administrative schedule that has 3 years of information the
company needs to report against.
Thx for any help.
Darrell
value from 8hrs to 0 hrs for a selected resource and selected assignment. I
then modified this macro to change all values in a date range to 0hrs for the
same assignment. And, for that one assignment it worked great – it zeroed all
values in the date range I entered. However, I could not make this same macro
work on another assignment when I changed the UID field to a different
assignment. Here is what I started with and what I modified it too. I do not
understand why I cannot change the UID field and rerun the macro on a
different assignment. I need someone who knows more than me, well that
probably includes everyone in this news group, to help me understand what I
am missing so that I can do a one-time fix on a schedule I inherited. Any and
all input will be greatly appreciated.
Original Macro –
Sub Test_2()
' Macro Post
' Macro Recorded Tue 10/28/08 by MCIGOV\dmarkham.
ActiveProject.Resources.UniqueID(453).Assignments.UniqueID(2097263).TimeScaleData(StartDate:="7/2/07
12:00 AM", EndDate:="7/3/07 12:00 AM", Type:=8, TimeScaleUnit:=4,
Count:=1).Item(1).Value = "0"
SelectTimescaleRange Row:=140, StartTime:="Tue 7/3/07", Width:=1,
Height:=1
End Sub
Changed to -
Sub Test2()
' Macro Test2
' Macro Recorded Tue 10/28/08 by MCIGOV\dmarkham.
Dim tsv As TimeScaleValue
Dim tsvs As TimeScaleValues
Set tsvs =
ActiveProject.Resources.UniqueID(453).Assignments.UniqueID(2097263).TimeScaleData(StartDate:="7/2/07
12:00 AM", EndDate:="9/6/08 12:00 AM", Type:=8, TimeScaleUnit:=4, Count:=1)
For Each tsv In tsvs
tsv.Value = "0"
Next tsv
End Sub
Like I said this worked great for the assignment I originally recorded the
macro for… I need it to work for any assignment I select by whatever method
is best so that I can remove some bad data and re-enter it work the correct
values in an Administrative schedule that has 3 years of information the
company needs to report against.
Thx for any help.
Darrell