Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Code that Changes Value of a Custom Field

Status
Not open for further replies.

WhtChoklat

Technical User
Jul 11, 2003
20
0
0
US
Here is the Code I currently have. Everything works except for the SetTaskField Method. Am I even using the right method. Can someone please help me.

Dim NumOfTask As Integer

NumOfTask = MSProject.ActiveProject.NumberOfTasks

For i = 1 To NumOfTask

Dim RemainingCost As Double
Dim BaselineCost As Double
Dim Cost1 As Double
Dim Cost2 As Double
Dim CostIndicator As Double
Dim Number6 As Object

RemainingCost = ActiveProject.Tasks(i).RemainingCost
BaselineCost = ActiveProject.Tasks(i).BaselineCost
Cost1 = ActiveProject.Tasks(i).Cost1
Cost2 = (Cost1 + RemainingCost)
CostIndicator = Cost2 / BaselineCost
Set Number6 = ActiveProject.Tasks(i).Number6

SetTaskField Field:=Number6, Value:=CostIndicator, AllSelectedTasks:=False, Create:=False, TaskID:=i, ProjectName:=ActiveProject

Next

Signed,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top