Jan 30, 2014

Setting the Project Gantt time scale - overcoming Zoom

One of the things I hate about Project is the Zoom function on the Gantt view. As it is, zooming leaves the scale in weird units on seemingly arbitrary boundaries. Given that, I wish it would zoom on the task table and leave the Gantt time scale alone. Frustrated with this, I wrote the following macro to easily reset the timescale to something sensible: showing 3 tiers with year, quarter, and month in a compact format. You may find this useful directly, or may want to play around with the constants to customize it.

Sub YQM_timescale()
' Changes the Gantt scale to show Year, Quarter, and Month
    TimescaleEdit TierCount:=3, Separator:=True, Enlarge:=80, _
        TopUnits:=pjTimescaleYears, TopLabel:=pjYear_yyyy, TopCount:=1, _
            TopAlign:=pjCenter, _
        MajorUnits:=pjTimescaleQuarters, MajorLabel:=pjQuarter_Qq, MajorCount:=1, _
            MajorUseFY:=True, MajorAlign:=pjCenter, _
        MinorUnits:=pjTimescaleMonths, MinorLabel:=pjMonth_m, MinorCount:=1, _
            MinorUseFY:=True, MinorTicks:=True
End Sub

Collapsing Project Summary Tasks that are 100% Complete

Here's a little VBA macro I wrote to toggle the collapse/expansion of Summary tasks that are complete. This can be useful as you move through the project and want to easily hide the clutter of completed work.

Sub collapseCompletedSummaryTasks()
' Toggles visibility into subtasks of completed summary tasks
    Static collapsed As Boolean
    Dim t
   
    If collapsed Then
        collapsed = False
    Else
        collapsed = True
    End If
   
    For Each t In ActiveProject.Tasks
        If t.Summary And t.PercentComplete = 100 Then
            If collapsed Then
                t.OutlineHideSubTasks
            Else
                t.OutlineShowSubTasks
            End If
        End If
    Next t
End Sub

More on Project Management - Microsoft Project, specifically

Over the past year and a half, I've been deeply intrenched in using MS Project on a couple of projects for which I've been the designated scheduler. While this has been great experience, I've learned that Project can't do a whole lot of things that I expected of it. Rather than whine about it, I've written a number of macros using Visual Basic for Applications to help me out. I thought that I'd dedicate some postings to sharing some of the solutions I've developed. I'll try to keep my griping about Project to a minimum, but will describe what I am trying to accomplish and have found to be lacking as I describe my solution.