title: How to SelectRow of a Task in Sub-Project (inside a Master-Project)
body: <p>I have a Master-Project, and inside it I have several Sub-Projects.</p>
  
  <p>I want to format the Color of the Rows based on a value of a field <code>Text5</code>.</p>
  
  <p><strong>Current Problem</strong>: How to use VBA code to refer to the Row in the 2nd Sub-Project.
  When I run the code, and I modify <code>Text5</code> value in Task ID 5 (in Sub-Project 2), it modifies the color of Task ID 5, but of Sub-Project 1.</p>
  
  <p>How can I use the <code>SelectRow</code> and add refference to the desired Sub-Project ?</p>
  
  <p><strong><em>My Code</em></strong> (relevant section)</p>
  
  <pre><code>Sub FormatChangedTasks()
  
  Dim SubPrj      As Subproject
  Dim Tsk         As Task
  Dim i           As Long
  
  For Each SubPrj In ActiveProject.Subprojects
      ' compare the name of Sub-Project with the one saved in the "Stack" srray
      If SubPrj.SourceProject.Name = ModifiedPrjName Then
          For Each Tsk In SubPrj.SourceProject.Tasks
              If Not Tsk Is Nothing Then
                  i = Tsk.ID
  
                  ' check if Tsk.Text5 value has changed from value in "StatusStackArr" array
                  If StatusStackArr(i - 1).StatusOldVal &lt;&gt; Tsk.Text5 Then
                      ' **** at the line below it selects the Row from the top
                      ' (not the desired Sub-Project) ******
                      SelectRow Row:=i, RowRelative:=False
  
                      ' --format entire row --
                      Select Case Tsk.Text5 ' Get the Field's used field, not name
                          Case "R", "Y", "G"
                              FontEx CellColor:=7, Color:=0
                              FontEx Italic:=False '  Font regular
  
                          Case "Complete"
                              FontEx Italic:=True '  Font Italic
                              FontEx CellColor:=15, Color:=14 ' Background Silver ; font Gray
  
                      End Select
  
                 ' rest of code (un-relevant)
  </code></pre>