I am trying to write a Macro that will search through each entry in a column, Baseline Work, determine if the value is greater than zero and if it is copy the cell to another column. This is what I have now however, it won’t run:
‘ Macro Trial
‘ Macro Recorded ’16 Nov 15.
Dim i As Integer
For i = 1 To 11
If Cells(i, “Baseline Work”).Value > 0 Then
SelectTaskField Row:=i, Column:=”Baseline Work”
SelectTaskField Row:=i, Column:=”Work”
Any help would be appreciated.
As there has not been any responses yet, I thought I’d post a possible solution.
Rather than use columns, this code uses tasks [each row in MSP is a display of specific task properties]
This code will update the task work field WHETHER OR NOT the Work OR the BaselineWork fields are displayed
‘Code to update Work field value of project tasks based on Baseline Work field Value
‘Assumption being that the Baseline Work value has been set and is > zero
Dim prj As Project
Dim tsk As Task
Set prj = ActiveProject
For Each tsk In prj.Tasks
If Not tsk.Summary Then ‘exclude summary tasks
If Not tsk Is Nothing Then ‘ exclude blank tasks
If tsk.BaselineWork > 0 Then
tsk.Work = tsk.BaselineWork
Set prj = Nothing