+ Reply to Thread
Results 1 to 3 of 3

I need to populate a given number of rows starting at a specific location

  1. #1
    Registered User
    Join Date
    05-28-2014
    Posts
    2

    I need to populate a given number of rows starting at a specific location

    Hello,
    I am new to this forum and also very new in using macros. I need help with one of the projects I'm working on.

    I have a spreadsheet where I track resources needed on a project. Each resource that is selected in the resource column has a corresponding % avg and an average number of months where the resource is used. % Avg and # of Months are found in a different worksheet.

    What I am looking to do is, for example: if resource A will be on the project starting in May 2015 and assigned at 30% for 7 months, I want to populate 30% starting in the colunm labeled May 2015 and copy the 30% so that a total of 7 months are populated. Also, if any of the values change (i.e: the Resource Name or the Start Month) I want to erase all the percentages that were entered in the row. How can I achieve that with a VBA code? I have formulas that retrieve the # of Months and the % Avg already.

    These are the columns that I have in my spreadsheet:
    Resource Name Start Month Jan-15 Feb-15 Mar-15 Apr-15 May-15 Jun-15 Jul-15 Aug-15 Sep-15

    Thanks for your help!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: I need to populate a given number of rows starting at a specific location

    Hi,

    You need a Sheet Change macro to detect when the resource name or month is changed. Assuming these are in say columns A & B and your months starting in column C then something like:

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    05-28-2014
    Posts
    2

    Re: I need to populate a given number of rows starting at a specific location

    Hi Richard Buttrey,
    I’m sorry if you’re getting a duplicate message, but I couldn’t see my reply. Thank you for your post, I appreciate your help!
    I used the code and here’s a snapshot of the results:

    ResourceName StartMonth Jan-15 Feb-15 Mar-15 Apr-15 May-15 Jun-15 Jul-15
    Applications Analyst Feb-15 10.88% 10.88% 10.88% 10.88% 10.88% 10.88% 10.88%

    The code doesn’t seem to take into account the starting month and it is populating all the months in the table.
    I have in column AF a formula that pulls the Avg % the selected resource is expected to spend on the project. In the code where you have “Your Formula” I referenced column AF.
    In column AG I also have a formula that pulls in the expected # of months the selected resource will be on the project. I think we need to reference this column as well in order for the code to know how many times to copy the data.
    How can it be done?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy rows to different sheet starting at a specific row
    By Mumps1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2013, 03:24 PM
  2. Replies: 0
    Last Post: 10-23-2012, 04:59 PM
  3. Replies: 5
    Last Post: 09-27-2012, 07:30 PM
  4. Replies: 6
    Last Post: 08-16-2012, 10:02 AM
  5. Replies: 1
    Last Post: 12-17-2010, 03:27 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1