PRJ: Custom Data Does Not Appear in Resource Usage View (317462)



The information in this article applies to:

  • Microsoft Project 2000
  • Microsoft Project 98 for Windows

This article was previously published under Q317462

SYMPTOMS

Some custom data that you enter while Microsoft Project is in Task view does not appear in Resource Usage view. This problem occurs when you enter data in a custom field (for example, Text 1-30, Number 1-20, Cost 1-20, and so forth) in Task view (for example, in Gantt Chart, Tracking Gantt, Task Sheet, and so on). The custom data does not appear next to the task name in Resource Usage view.

CAUSE

This behavior occurs because Resource Usage view is made up of resource information and assignment information. The rows that display the names of the tasks for each resource are assignment rows and do not map to the task information.

RESOLUTION

To solve this problem, create and run the "UpdateAssignmentNumber1()" macro shown later in this article. The macro copies the data in the Number1 field from the Task rows in the Gantt Chart to the appropriate assignment rows in Resource Usage view. To create the macro, follow these steps.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site: For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
  1. Start Microsoft Project.
  2. On the Tools menu, point to Macro, and then click Macros.
  3. In the Named box, type UpdateAssignmentNumber1, and then click Create.
  4. In the Microsoft Visual Basic Editor, insert the following block of code between
    Sub UpdateAssignmentNumber1()
    					
    and
    End Sub
    					
    
    
    'Variables for tracking current task and assignment
    
    Dim oTask As Task
    
    Dim oAssignment As Assignment
    
       
    
    'Looping through all tasks in the project
    
    For Each oTask In ActiveProject.Tasks
    
        'Checking to see if task is blank
    
        If Not oTask Is Nothing Then
    
            'Looping through each assignment for a task
    
           For Each oAssignment In oTask.Assignments
    
            'Updating the number1 field for the assignment based on value 
            'at task level for the number1 field
    
                oAssignment.Number1 = oTask.Number1
    
            'Processing next assignment for the task
    
            Next oAssignment
    
        End If
    
    'Processing next task
    
    Next oTask
    
    
    					
To run the macro, follow these steps:
  1. Start Microsoft Project.
  2. On the Tools menu, point to Macro, and then click Macros.
  3. In the Macros in dialog box, click the macro that you just created, and then click Run.

Modification Type:MinorLast Reviewed:1/7/2006
Keywords:kbprb KB317462