+ Reply to Thread
Results 1 to 7 of 7

Insert multiple rows and copy paste text from different sheet based on cell Value

  1. #1
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Insert multiple rows and copy paste text from different sheet based on cell Value

    Hi, I am trying to add multiple rows based on the data and then copy the text from another sheet.

    In the attached sample sheet, my data is in output sheet, based on Col D, if it says ABC-1, then it should add two more rows below it and copy text "Ref" sheet from Col B till Col E and paste in output sheet in Col G till J and Col B till Col F will remain same in the added row,

    Similarly, it should check next rows for ABC-2 and ABC-3 in col D and do the same (number of rows to be added are different for each keyword)

    To make it clear I have added a sample output sheet that I am looking for.

    I tried but stuck in adding row itself my code is adding just 1 row that too only for ABC-1. Need not to say I am new to VBA.

    Would appreciate all your help.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    Not sure if you put the corrected ABC code, there are twice ABC-1.

    In my understanding, please try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    Hi amitmodi_mrt,

    Your expected results in sheet 'Sample Output' is confusing. What determines how many rows to insert ? In sheet 'Sample Output' for ABC-2 you have 6 rows but in your 'Ref' sheet you have 7 & the last few rows in sheet 'Sample Output' it shows 7 rows but your model is ABC-1

  4. #4
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    Thank you Bo_Ry, this works perfect, only one question, can it add the line and do the need fullin the "Output" sheet itself instead of "Sample Output" sheet?

  5. #5
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    I am Sorry Bo_Ry and nankw83 I did a typing error, last one in Output and Sample output should be ABC-3. My Apologies.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    Please try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-13-2008
    MS-Off Ver
    Office 365
    Posts
    134

    Re: Insert multiple rows and copy paste text from different sheet based on cell Value

    Thanks a lot Bo_Ry... this is as expected.. thank you.

+ 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 based on cell value and paste on a new sheet
    By cowboy14 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2017, 03:09 PM
  2. [SOLVED] Copy and Paste rows to multiple worksheets based on a cell value.
    By gaidon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2013, 12:43 PM
  3. Excel Macro to insert two rows based on condition and copy and paste multiple cells
    By mannabhalo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2012, 12:56 PM
  4. Insert a number of rows based on a cell value and copy formulas on multiple worksheets
    By Charleneq40 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 12:45 PM
  5. [SOLVED] Insert Multiple Rows Based Off Number in Cell and Copy Data From Above New Rows
    By tstell1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2012, 04:15 PM
  6. Insert multiple rows from one sheet to another based on a value in a cell
    By sashikanth2274 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2010, 11:37 PM
  7. Copy\Paste multiple criteria based rows to new sheet
    By namz in forum Excel Programming / VBA / Macros
    Replies: 46
    Last Post: 06-06-2008, 08:08 AM

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