In MS Project alternate row background colour using VBA RRS feed

  • Question

  • Recently I bought a book VBA Programming for Microsoft Project, by Rod Gill to learn to right a code for my Gantt. Problem is when I am printing on a large full size page it is hard to follow rows to the gantt bar. If any good solution or code that can create a specified shade of color of row all the way up to start of gantt bar.

    Currently using MS Project 2003. If no code for 2003 then I will buy upgrade to 2007. I have very basic knowledge of using VBA code. I am still reading this book and kind of lost.



    Saturday, June 29, 2013 10:16 AM

All replies

  • Generally I fix this by adding gridlines to every other row in the Gantt (right click on the Gantt Chart, and select the gridlines option).

    That would be easier than coding up a solution.

    Andrew Lavinsky [MVP] Blog: Twitter: @alavinsky

    Saturday, June 29, 2013 2:25 PM
  • Mokbash,

    I think Andrew's solution is the best you are going to find. There is nothing in the Project object library, for any version of Project, that will allow you to do what you want. You can apply a background color to the tabular data but there is no way to extend that up to the Gantt bar.


    Saturday, June 29, 2013 2:47 PM
  • John is correct here. The reason there isn't code on how to do this in my book is that VBA can only do what you can do manually with Project. In this case you can't do what you want manually, so VBA can't do it either.

    But Andrew has offered the solution most people use: gridlines.

    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Monday, July 1, 2013 9:14 PM
  • Rod,

    Sorry but I must take exception to the statement, "VBA can only do what you can do manually". For example, as far as I know, there is no way to see all the start and stop dates for a task with multiple splits, except on the Gantt Bar itself. However, these dates are easy to extract using VBA.


    Monday, July 1, 2013 9:23 PM