Loading...
Quick Links

Reply To: Macro to search through values in a column

Home Forums Discussion Macro to search through values in a column Reply To: Macro to search through values in a column

#406923
Andy Forrester
Guest

Emma,
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
Sub UpdateWork()
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
End If
End If
End If
Next tsk

Set prj = Nothing
End Sub