+ Reply to Thread
Results 1 to 10 of 10

Copy and insert rows based on user input

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Copy and insert rows based on user input

    Hi everyone,

    I found the following code which I believe partially does what I need:

    Please Login or Register  to view this content.
    What I need to do is have rows 9 - 18, columns B - S copied and pasted below each other based on the number the user inputs in the MSGbox. So if the user enters 3 in the Msgbox, B9 - S18 will be copied 3 times one below the other starting at B19.

    Any ideas?

    Thanks!!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and insert rows based on user input

    Does this help?

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Copy and insert rows based on user input

    Hi John,

    Thanks. Your code seems to partially work. It takes the reuslts in the B9:S18 range and copies it but then removes the rows at the top of the worksheets and pastes the results in. Also, it seems to only paste the check boxes and not the remaining content. Any ideas?

    Thanks very much for your help.
    Last edited by Groovicles; 03-26-2015 at 02:20 PM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and insert rows based on user input

    Try:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Copy and insert rows based on user input

    Hi John,

    That worked much better. The only thing now is that there is content below the range of cells, so I'd actually need the entire 8 rows copied down, not just the contents of the range. Manually, we would just insert 8 rows starting at row 17 and copy the range in that. Any ideas?

    Thanks,

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and insert rows based on user input

    Try:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Copy and insert rows based on user input

    Hi John,

    Thanks very much. The range is now copying perfectly below depending on the number entered by the user. However, they are being copied over the data in the cells that's already directly below it. I'm thinking we need to specifiy how many rows are inserted first below 19 and then copy. In that way the data that's already below 19 will simply shift down as the rows are entered. Would that work?

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and insert rows based on user input

    Maybe:

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Copy and insert rows based on user input

    Thanks so much, John. Works great.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy and insert rows based on user input

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. Insert # of Rows based on User Input
    By afpilotb1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2014, 11:40 AM
  2. copy rows based on 1 criteria + user input + pastevalues (almost there...)
    By Dieneces in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2013, 10:38 AM
  3. Macro to Copy Rows based on User Input
    By CharterJP in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-24-2012, 06:13 PM
  4. [SOLVED] Macro based on User input to Insert X amount of rows - Need advanced help
    By BuzzOffSweetheart in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2012, 07:06 PM
  5. Insert rows based on user input from cell value in other sheet
    By MrPisky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-31-2011, 09:08 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