P
Peter Rooney
With reference to me earlier post of copying and pasting only visible rows, I
decided to try to write some code to test for tasks allocated to a certain
sub team in my department (in this example, "Core Tools", as shown below)
There are a number of level 2 tasks, each split into a number of level 3
teams thus:
Project 1
Team 1
Activity 1
Activity 2
Team 2
Activity 1
Activity 2
Project 2 etc etc
and each has various levels of sub task below that, sown to about level 7 or
8.
I filter the plan so that it looks something like this, to show my "Core
Tools" team activities
Project 1
Core Tools
Project 2
Core Tools
Project 3
Core Tools
etc etc
What I want is to test all tasks, and where the Level 3 task is shown as
"Core Tools" (for example), show ALL the subtasks for the task to show
something like:
Project No. 1 (level 2 task)
Core Tools (level 3 task)
Level 4 task
Level 5 task
Level 4 task
Level 5 task
Level 6 task
Project No. 2 (level 2 task)
Core Tools (level 3 task)
Level 4 task
Level 5 task
Level 6 task
etc etc
---------------------------------------------------------------------------
Here's the code I wrote:
Sub AAMin()
Dim LoopTask As Task
SelectSheet
For Each LoopTask In ActiveSelection.Tasks
If Not LoopTask Is Nothing Then
If LoopTask.Name = "Core Tools" Then
LoopTask.OutlineShowSubTasks
End If
End If
Next LoopTask
End Sub
I did try getting it to select the row for the task that needs to be
unpacked - but if I did, my loop went wrong and couldn't find the next
matching row, as the selection had changed. - I thought that I'd be able to
use "OutlineShowSubTasks" as a method(?) for my Task object, "LoopTask", but
nothing happens and the outline tasks aren't shown. Doubtless someone will
have a more elegant way of doing it than me - help me out please, it's Friday
afternoon and I don't want to spend all weekend puzzling over this.
Thanks in advance
Pete Rooney
decided to try to write some code to test for tasks allocated to a certain
sub team in my department (in this example, "Core Tools", as shown below)
There are a number of level 2 tasks, each split into a number of level 3
teams thus:
Project 1
Team 1
Activity 1
Activity 2
Team 2
Activity 1
Activity 2
Project 2 etc etc
and each has various levels of sub task below that, sown to about level 7 or
8.
I filter the plan so that it looks something like this, to show my "Core
Tools" team activities
Project 1
Core Tools
Project 2
Core Tools
Project 3
Core Tools
etc etc
What I want is to test all tasks, and where the Level 3 task is shown as
"Core Tools" (for example), show ALL the subtasks for the task to show
something like:
Project No. 1 (level 2 task)
Core Tools (level 3 task)
Level 4 task
Level 5 task
Level 4 task
Level 5 task
Level 6 task
Project No. 2 (level 2 task)
Core Tools (level 3 task)
Level 4 task
Level 5 task
Level 6 task
etc etc
---------------------------------------------------------------------------
Here's the code I wrote:
Sub AAMin()
Dim LoopTask As Task
SelectSheet
For Each LoopTask In ActiveSelection.Tasks
If Not LoopTask Is Nothing Then
If LoopTask.Name = "Core Tools" Then
LoopTask.OutlineShowSubTasks
End If
End If
Next LoopTask
End Sub
I did try getting it to select the row for the task that needs to be
unpacked - but if I did, my loop went wrong and couldn't find the next
matching row, as the selection had changed. - I thought that I'd be able to
use "OutlineShowSubTasks" as a method(?) for my Task object, "LoopTask", but
nothing happens and the outline tasks aren't shown. Doubtless someone will
have a more elegant way of doing it than me - help me out please, it's Friday
afternoon and I don't want to spend all weekend puzzling over this.
Thanks in advance
Pete Rooney