Macro or VBA Help?

D

Darrell

I have an Administrative schedule I inherited that is full of corrupt data
during a specific date range. I have the same data available from a different
source and would like to re-enter the good data into the schedule beginning
at a selected date for each resource without changing data prior to the
selected date. Is there a way to delete entered work values for a resource
beginning at a selected date (or within a date range) without deleting data
prior to (or after) the selected date (range)? I tried a macro working in the
Resource Usage view but was unable to make it work properly. Is there a way
to automate removing work values on long tasks for just a select date range?
If I can get the bad data zeroed out I can enter the new data much quicker,
if I do not have to hunt to remove the old data. Any VBA Gurus who can set me
on the path to creating a solution? I specifically want to delete work values
for a resource on a specific assignment by date range. Any suggestions
greatly appreciated.

Darrell
 
D

Darrell

So I got this far but I cannot figure out why I cannot set the tsv.Value =
"0". I am out of my knowledge area and could use a little help from those who
do this more often than I do if at all possible.

Dim tsv As TimeScaleValue
Dim tsvs As TimeScaleValues
Set tsvs =
ActiveProject.Resources.UniqueID(453).Assignments.UniqueID(2097754).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

Darrell
 
D

Darrell

FYI - if I use the macro recorder to create the TimeScaleData information and
then add the Dim, Set and For Each statements between the TimeScaleData
string the macro works for the line I used to create the macro, but not on
other lines... gotta be a way to make this work for any resource UID and
assignment UID I just aint got what it takes to figure it out

Darrell
 
D

Darrell

Reposted to the Developers Group

Darrell said:
FYI - if I use the macro recorder to create the TimeScaleData information and
then add the Dim, Set and For Each statements between the TimeScaleData
string the macro works for the line I used to create the macro, but not on
other lines... gotta be a way to make this work for any resource UID and
assignment UID I just aint got what it takes to figure it out

Darrell
 
M

Maurice Birchler

Darrell,
I think you are trying to treat the TimescaleData as if it were real data
when by default it is calculated.
You could try saving the project as a MS-Access database using the option to
expand the TimeScaleData, then edit the values in the MS-Access tables (using
Access) and re-open with MS-Project and save in the .mpp format again.
I have not done this. It is just an idea.
Maurice
 

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