Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Indenting by exeption MS Project

Status
Not open for further replies.

Palmcrest

Technical User
Jul 10, 2006
66
AU
Hi, I have been working with some code that takes the text from text3 places it in the name column and indents the relevent tasks by one level.
Thanks to PDQBach for getting me this far.
============================================================================================
Sub WOHeaderIndent()
Dim boolAllDone As Boolean
Dim lngTask As Long
Dim strSaveText3 As String

Application.Calculation = False
SelectTaskField row:=1, Column:="Name", rowrelative:=False
EditInsert
SetTaskField Field:="Name", Value:="Updated"

lngTask = ActiveProject.Tasks.Count
strSaveText3 = ActiveProject.Tasks(lngTask).Text3
boolAllDone = False
Do
If ActiveProject.Tasks(lngTask).Text3 = strSaveText3 Then
ActiveProject.Tasks(lngTask).OutlineLevel = 2
lngTask = lngTask - 1
Else
SelectTaskField row:=lngTask + 1, Column:="Name", rowrelative:=False
EditInsert
SetTaskField Field:="Name", Value:=strSaveText3
SetTaskField Field:="Outline Level", Value:=1
SetTaskField Field:="Text3", Value:=strSaveText3
strSaveText3 = ActiveProject.Tasks(lngTask).Text3
End If
Loop Until lngTask = 1

SelectTaskField row:=1, Column:="Name", rowrelative:=False
SetTaskField Field:="Text3", Value:=strSaveText3
Application.Calculation = True
End Sub
=========================================================================================
What I would like to do is only indent the tasks where Text 26 = "NEW"
I have tried unsuccesfully to use if then. Can someone show me please how to limit the indenting to only tasks that comply with text 26 equaling "NEW"

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top