Any help is greatly appreciated.
Thanks in advance.
I've written that already but.. are you aware that task on numner N+1 cannot
have a level larger than the one on task N plus 1? If yes, try this snippet:
for each job in activeproject.tasks
if not job is nothing then
do while job.number7 > job.outlinelevel
job.outlineindent
loop
do while job.number7<job.outlinelevel
job.outlineoutdent
loop
end if
next job
Two remarks on this
1. Don't try to address BOM_Level, VBA does not know this alias (unmess it
is defined on Project server but even then job.BOM_Level will not work)
2. You may have hundreds of error messages if the outline levels cannot be
achieved - I did not program error routines, that I leave up to you :-))
Greetings,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
"wiwchar" <wiw...@discussions.microsoft.com> wrote in message
news:0669575C-F8BF-45A2...@microsoft.com...
Tried running this and the code stopped at
job.outlineoutdent
I changed the job.number7 to job.number1 as this was the field that I named
BOM_Level.
Any more insight?
Thanks.
"Jan De Messemaeker" wrote:
> .
>
Sub indentme()
For Each Task In ActiveProject.Tasks
Task.OutlineLevel = Task.Number1
Next Task
End Sub
-Jack Dahlgren
"wiwchar" <wiw...@discussions.microsoft.com> wrote in message
news:0669575C-F8BF-45A2...@microsoft.com...
Isn't that number field then 0?
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
"wiwchar" <wiw...@discussions.microsoft.com> wrote in message
news:1C310ADB-1D9A-41B3...@microsoft.com...
"Jack Dahlgren MVP" wrote:
> .
>
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
"wiwchar" <wiw...@discussions.microsoft.com> wrote in message
news:2E75D0F4-CEF5-4EF9...@microsoft.com...
Is there a way to upload a sample file or a PPT to show what I am working
with?
Thanks again.
"Jan De Messemaeker" wrote:
> .
>
The code below handled 1365 tasks in less than 2 seconds. I didn't add the
code needed to determine the maximum value for the number1 field, in the file
I used it was 8. You can add the code or use autofilter to look up the
maximum value and ask for the value in an input box. Thanks for having
trouble with the other macros, now that I developed this I'm going to use it
for fixing corrupt files.
Sub SetLevelByValue()
StartTime = Timer
For mylevel = "2" To "8"
FilterEdit Name:="OutlineLevel", TaskFilter:=True, Create:=True,
OverwriteExisting:=True, FieldName:="Number1", Test:="is greater than or
equal to", Value:=mylevel, ShowInMenu:=False, ShowSummaryTasks:=False
FilterApply Name:="OutlineLevel"
SelectSheet
OutlineIndent
Next mylevel
FilterApply Name:="All Tasks"
mydur = Timer - StartTime
MsgBox prompt:="This took " & mydur & " seconds"
End Sub