That logic can be easily changed to look at task name, a text field, etc. For this example, the Flag1 field is used to identify the tasks that should have subtasks. Here's a basic macro that adds subtasks to specific tasks if they don't already have subtasks. ![]() Tasks.Add tsk.Name + " " + "name3", tsk.ID + 3 Tasks.Add tsk.Name + " " + "name2", tsk.ID + 2 Tasks.Add tsk.Name + " " + "name1", tsk.ID + 1 Tasks 2 to 11 should show those exact three subtasks. The image below shows how the subtasks should show under each task after you run the script. Each task in Project have the same three subtasks. In other words, I need to automatically add the three subtasks whenever there is a new task in the Project file. However, now I need to automatically add three subtasks to each main task in Project after importing the Excel file without replacing the subtasks of the tasks that were already in the file. I used the Project import wizard to map the fields so when I merge the Excel file into Project the mapped fields are updated and new tasks are added when there is a new row in the Excel file. ![]() The Excel file is refreshed each week with new rows. So I have an Excel file where each row is a new task in Microsoft Project.
0 Comments
Leave a Reply. |