locked
task id in resource usage view RRS feed

  • Question

  • Hello,

    can someone help me find a way to have the task id in the resource usage view? i understand this was dropped in project 2010; does anyone have a VBA code that can help me achieve this?

    Thanks,

    Thursday, November 14, 2013 1:45 AM

Answers

  • I have a Project 2013 eBook update to my VBA book coming out. Not much new in it so I'm adding a number of useful macros. This is adapted from one of them:

    Sub CopyTaskDataToResourceAssignments()
    Dim Assgn As Assignment
    Dim Res As Resource
        For Each Res In ActiveProject.Resources
            If Not Res Is Nothing Then
                For Each Assgn In Res.Assignments
                    Assgn.Text1 = Assgn.TaskID
                Next Assgn
            End If
        Next Res
    End Sub
    

    Insert text1 in your Resource Usage View after running this macro and enjoy!


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    • Marked as answer by eagle_one34 Thursday, November 14, 2013 11:40 AM
    Thursday, November 14, 2013 8:40 AM

All replies

  • I have a Project 2013 eBook update to my VBA book coming out. Not much new in it so I'm adding a number of useful macros. This is adapted from one of them:

    Sub CopyTaskDataToResourceAssignments()
    Dim Assgn As Assignment
    Dim Res As Resource
        For Each Res In ActiveProject.Resources
            If Not Res Is Nothing Then
                For Each Assgn In Res.Assignments
                    Assgn.Text1 = Assgn.TaskID
                Next Assgn
            End If
        Next Res
    End Sub
    

    Insert text1 in your Resource Usage View after running this macro and enjoy!


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    • Marked as answer by eagle_one34 Thursday, November 14, 2013 11:40 AM
    Thursday, November 14, 2013 8:40 AM
  • Hey Rod, don't sell the book short, it's an excellent ref, whether 2007, 2010 or the to be released 2013 version.  Everyone should buy one and then you could retire :) 

    Ben Howard [MVP] <a href="http://www.applepark.co.uk/ben-howard-blog/">blog</a> | <a href="http://www.applepark.co.uk">web</a>

    Thursday, November 14, 2013 11:14 AM
  • Rod,

    Thanks alot as usual; very helpful.

    looking forward to buying the updated eBook.

    Thanks,

    Thursday, November 14, 2013 11:45 AM
  • I tried using this macro in a Project 2013 schedule (not Server version) and it produces an Error 1101 at the line

    Assgn.Text1 = Assgn.TaskID

    If I debug and hover over the left side it shows a null string and hovering over the right side shows a valid task ID (7 in my case).  I tried changing it to Assgn.Text1 = Str(Assgn.TaskID), thinking that it was having trouble converting the int to a string, but that didn't help (I assume TaskID is an Integer and not a Variant).

    Anyway, does anybody have a thought as to why I'd be getting this error?

    Thanks.

    Bill Lugg

    Wednesday, December 11, 2013 12:05 AM
  • Check you've not got something configured on the field definition for text1. If you've got "Roll down unless manually entered" set on the Calculation for Assignment rows then that could cause this error.

    Ta,

    Andrew

    Wednesday, December 11, 2013 2:11 PM