+ Reply to Thread
Results 1 to 8 of 8

Copy Data from Different Tab and Paste the Data X Number of Times

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2016
    Posts
    17

    Copy Data from Different Tab and Paste the Data X Number of Times

    Hello!

    On Sheet1, I have the following values beginning in Cell A4 (these values are also part of a Named Range):

    Cat
    Dog
    Mouse

    I would like to paste these values into Sheet2 beginning in Cell G2. I would like to paste them in the number of times specified in Cell B2 of Sheet2. So for instance, if Cell B2 in Sheet2 says 4, Column G would say:

    Cat
    Dog
    Mouse
    Cat
    Dog
    Mouse
    Cat
    Dog
    Mouse
    Cat
    Dog
    Mouse

    Is there a macro that would accomplish this? Thank you!

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    Hi Lyndy,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    Last edited by Trebor76; 05-11-2013 at 01:28 AM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    Try this code...

    Please Login or Register  to view this content.
    Last edited by :) Sixthsense :); 05-11-2013 at 01:27 AM.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy Data from Different Tab and Paste the Data X Number of Times


  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2016
    Posts
    17

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    Thanks Sixthsense. This is almost exactly what I need.

    Instead of hardcoding the "copy to" spreadsheet in the macro (i.e. Set wRes = Sheets("Sheet2")

    Is it possible to have the macro copy the data to the active sheet regardless of its name? How would I update the macro to accomplish this?

    Thank you!

  6. #6
    Registered User
    Join Date
    05-10-2013
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2016
    Posts
    17

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    AB33 - This is not a duplicate post. I did post twice to the forum - once with a need to copy data within a single sheet in Excel and a different question about needing to copy data from a different sheet in Excel to another one. Thank you for any input you can provide.

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    Change this

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-10-2013
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2016
    Posts
    17

    Re: Copy Data from Different Tab and Paste the Data X Number of Times

    Just what I needed. Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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