Consulting

Results 1 to 6 of 6

Thread: MACRO TO LINK EACH RESOURCE NAME

  1. #1
    VBAX Regular
    Joined
    Aug 2015
    Posts
    7
    Location

    MACRO TO LINK EACH RESOURCE NAME

    I'm working on a macro to link each "Resource Name" together for this Gant chart (see attachment) and have been unsuccessful. The macro only works on this same report but would like to see if there is a VBA code that could link the same "Resource Name".
    Attached Images Attached Images

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Let us see what code you have. Please use the # icon on the editor to put code tags around your code. The easiest way is to click the icon, then paste your code between the tags.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Aug 2015
    Posts
    7
    Location
    Sub Macro2()
    ' Macro Macro2
    ' Macro Recorded Sun 8/16/15 by ROBERT.resource names linked together.jpg
        SelectTaskField Row:=0, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=4, Column:="Resource Names", Height:=5
        LinkTasks
        SelectTaskField Row:=6, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=4, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=5, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=4, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=2, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=2, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=2, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=2, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=1
        LinkTasks
        SelectTaskField Row:=2, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=5, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=3
        LinkTasks
        SelectTaskField Row:=4, Column:="Resource Names", Height:=2
        LinkTasks
        SelectTaskField Row:=3, Column:="Resource Names", Height:=1
        LinkTasks
    End Sub

  4. #4
    VBAX Regular
    Joined
    Aug 2015
    Posts
    7
    Location
    What I'm trying to do is link the "same" resource name. The macro records rows and each day will be recorded different b/c each resource name does not have the same # of jobs to line up with the macro. So, I'm looking for a code that can link resources that share the same name, if that makes better sense.
    Attached Images Attached Images

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Rob,


    While I am pretty good with all VBA code, I do not have MS Project on my Computer. I did Download the 2002 Project help file, and a brief perusal suggest that you need to work with the Resources Collection and or ResourceName Field.

    For Example:
    With Column:="Resouces Nzmes"
    For Rw = 1 to LastRow
    Resources(Row:=Rw).Assignments.Add Tasks(Taskfield Row:=Rw)
    Next
    End With

    And Then:
    For Each RN in Resources
    .Assinments.Link
    Next

    No, that is not real code, that is why I did not format it nor correct typos. I am just trying to give you an idea. I might buy an old version of Project and see if I can't bring some life to this forum, but that can't happen until early 2016.

    I am very sorry we can't be more helpful. Please subscribe to this thread so you can get Emailed notification if anybody else posts here. I am sure that somebody knows more about Project than I do.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    VBAX Regular
    Joined
    Aug 2015
    Posts
    7
    Location
    No problem! Will subscribe to this and thanks for your time and informational link SamT. Happy Coding

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •