+ Reply to Thread
Results 1 to 5 of 5

Insert rows based on a number and copy complete row

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    20

    Insert rows based on a number and copy complete row

    Hello,

    I am looking for a VBA code which should insert the the row based on a cell value(which will be number) and copy that complete row.

    Ex:
    100024301 DEU 119340991 3
    63588 CAN 1165584 2
    15725 JPN 109590 1

    O/P required:
    100024301 DEU 119340991 3
    100024301 DEU 119340991 3
    100024301 DEU 119340991 3
    63588 CAN 1165584 2
    63588 CAN 1165584 2
    15725 JPN 109590 1

    Please let me know the code for this.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Insert rows based on a number and copy complete row

    Hello there,

    Try the following:
    Please Login or Register  to view this content.
    To insert the code:
    1. Press Alt+F8
    2. Clear the macro name field and then type InsertRw
    3. Select the Create option
    4. In between the Sub InsertRw and End Sub copy and paste the above code
    5. Anything that appears in green is a comment meant to help you understand each line
    6. Close out of Visual Basic

    To run the code:

    1. Select the worksheet
    2.Press Alt+F8
    3. select the InsertRw macro and select Run

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Insert rows based on a number and copy complete row

    Thank you so much...It works for me, I just had to make few minor changes to get the proper output.

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Insert rows based on a number and copy complete row

    Glad it helped!

    Please don't forget to mark this thread SOLVED and maybe give a little star tap to add to my reputation points if I helped.

    Thanks!

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Insert rows based on a number and copy complete row [Solved]

    Surely it helped a lot to solve my issue.
    Here goes my rating marked.

    Thanks once again

+ 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