H
Hadi
Hello Experts,
I have a project file where outline level 1 is the project name and then i
have 6 outline level 2 summary tasks and the rest are subtasks. I want to be
able to copy the outline level 1 activity down to all the tasks to Text1 (for
example). I have a macro that i got from somewhere online (after making some
changes), and it does the job. My questions is, if I change the structure
where the 6 summary tasks to Outline level 1 and show the project summary
task (which is outline level 0), how can i adjust the macro to work in that
arrangement? I tried changing it but was not successful. here is the macro i
have now:
Dim mystring As String
Dim mytask As Task
Dim myoutlinelevel As Integer
Dim t As Task
Dim val1 As String
myoutlinelevel = 1
For Each mytask In ActiveProject.Tasks
If Not (mytask Is Nothing) Then
If mytask.OutlineLevel = myoutlinelevel Then
mytask.Text1 = mytask.Name
End If
End If
Next mytask
OutlineShowTasks expandinsertedprojects:=True
SelectTaskColumn
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If t.OutlineLevel = 1 Then
val1 = t.Text1
Else
t.Text1 = val1
End If
End If
Next t
End Sub
I have a project file where outline level 1 is the project name and then i
have 6 outline level 2 summary tasks and the rest are subtasks. I want to be
able to copy the outline level 1 activity down to all the tasks to Text1 (for
example). I have a macro that i got from somewhere online (after making some
changes), and it does the job. My questions is, if I change the structure
where the 6 summary tasks to Outline level 1 and show the project summary
task (which is outline level 0), how can i adjust the macro to work in that
arrangement? I tried changing it but was not successful. here is the macro i
have now:
Dim mystring As String
Dim mytask As Task
Dim myoutlinelevel As Integer
Dim t As Task
Dim val1 As String
myoutlinelevel = 1
For Each mytask In ActiveProject.Tasks
If Not (mytask Is Nothing) Then
If mytask.OutlineLevel = myoutlinelevel Then
mytask.Text1 = mytask.Name
End If
End If
Next mytask
OutlineShowTasks expandinsertedprojects:=True
SelectTaskColumn
For Each t In ActiveProject.Tasks
If Not t Is Nothing Then
If t.OutlineLevel = 1 Then
val1 = t.Text1
Else
t.Text1 = val1
End If
End If
Next t
End Sub