none
Project 2013 - Question re: Macro to recolor Gantt bars based on text value (ie Cost Center) in a Custom Text Field RRS feed

  • Question

  • Hi,

    I'm working with project plans in which the Cost Centers (Dept/Groups) are indicated within a custom Text Field.  Client would like to have the Gantt Bars color coded to the cost center.  I do not know VBA, however took a stab at recording a simple macro to do this which Filters the Text Field for one specific cost center, changes bars of all tasks, then repeats, for all 6  cost centers.  And it worked!  Until there was a file which did not include all 6 cost centers.... once the macro encountered the line where it filtered for the "missing" cost center.... it cut out.

    Just wondering how the more experienced would approach this.  I've been using MS Project for almost 20 years and can do a lot with it, but this one request really has me scratching my head.

    thanks!

    mary.Roberts.2029@gmail.com

    Thursday, September 28, 2017 7:36 PM

All replies

  • Mary,

    As far as how I would approach this, I'd set up the bar colors to correspond to six flag fields. Then I'd customize each of the 6 flag fields with a IIF statement in a formula that tests for the cost center code and sets the flag if present. No macro required.

    John



    • Edited by John - Project Friday, September 29, 2017 12:18 AM alternative
    Thursday, September 28, 2017 7:54 PM