0

how can I run a macro (formats some cells of a task) in MS Project by changing the value of a specific cell via a dropdown menu?

E.g. I want to change the font color to green, if I choose "done" from a custom field entry that uses a lookup with the possible entries "open"; "done".

thank you very much! Best, AF

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
P. Udge
  • 11
  • 3

1 Answers1

0

Start by listening for a Application.ProjectBeforeTaskChange event. When your custom field is changed, then you can tweak the format of your task; this may be helpful: https://superuser.com/questions/1117019/ms-project-change-text-color-in-row-based-on-status-field

It can be tricky manipulating the cells of the task table based on the task ID, especially if you use subprojects; another helpful reference is: How to SelectRow of a Task in Sub-Project (inside a Master-Project)

Jerred S.
  • 351
  • 1
  • 4
  • Note: you can't apply formatting within the ProjectBeforeTaskChange event. You are better off starting with a manually-run macro as linked to above. Once you have that running as you like, you can experiment with calling it from the Project_Change event, although likely you would not want to run that at every change in the project. Unfortunately, Project does not have a ProjectAfterTaskChange event. Alternatively, you can tie formatting to the Marked field which is a yes/no field and might work for you (search for Gantt text formatting). – Rachel Hettinger Feb 22 '19 at 23:18