+ Reply to Thread
Results 1 to 9 of 9

Macro to Copy Rows based on User Input

  1. #1
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Macro to Copy Rows based on User Input

    Hi Excel Experts,

    Here is my problem and I've included a test workbook as well. I have a list of rows each with a unique id. What I need is to beable to pick any of the id's and then specify the number of times I want that id copied below the cell (each copy creating a unique sub id) forexample. If I am copying id 1 two times. the sub ids could be 1.1 and 1.2. Further, each of the rows, the one copied from and the copies of that row need to be populated with data sets. See Column H, I and J from row 2 through 7. They have blank columns in the table that will match.

    Can you help?mocktest.xlsx
    Last edited by CharterJP; 07-24-2012 at 05:21 PM.

  2. #2
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Copy Row Issue

    Do my example require further explaining? I would greatly appreciate some help on a solution.

  3. #3
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Macro to Copy Rows based on User Input

    I do not mean to harp but I could really use some help on this.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to Copy Rows based on User Input

    Hi

    Here's a start.

    Please Login or Register  to view this content.
    rylo

  5. #5
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Macro to Copy Rows based on User Input

    Rylo,

    You are awesome! Thank you for this piece. It works beautifully. Would you happen to have thoughts on how to populate the newly created and copied cell with the data in H2 through J7?

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to Copy Rows based on User Input

    Hi

    I'm working on the principle that the number of extra rows, plus the original will match the number of rows of data to be filled in columns H:J.

    Please Login or Register  to view this content.
    rylo

  7. #7
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Macro to Copy Rows based on User Input

    This macro works very well. The data I used in H:J is only a very small set of the actual. I will have to adjust the macro to fit the range needed. Otherwise, I can't thank you enough!

  8. #8
    Registered User
    Join Date
    11-02-2010
    Location
    Albuquerque, NM
    MS-Off Ver
    Excel 2007
    Posts
    99

    Re: Macro to Copy Rows based on User Input

    Rylo, I am having an issue with this code. I am using in my work book as it is writen and when I get past the first few IDs it starts copying all the way down and losing ID order. Could you help?

  9. #9
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Macro to Copy Rows based on User Input

    Hi

    Put up an example file that replicates the problem, and include the code.

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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